SliderCellType hotspot is offset when slider minimum is negative

Posted by: andrewl-fp on 8 September 2017, 5:06 am EST

  • Posted 8 September 2017, 5:06 am EST

    One of the spreadsheets I have is using SliderCellTypes to allow the user to change certain threshold levels. The minimum and maximum values for these sliders are configurable and by default, the minimum is 0. There are a few rare cases where the user needs to set some of these minimums to below 0 and when they do, the hotspot for the slider moves up by a number of pixels that seems to match the minimum. So if the minimum is -100, the user has to click 100 pixels higher than the slider itself in order to drag it around. Since the cells generally aren't 100 pixels high, clicking in the cell will just automatically set the slider to the minimum value and then as you drag, the slider will follow 100 pixels behind. As soon as we set the slider minimum back to 0 or higher, it behaves normally again. I'm using v4.0.3510, which I know is a few versions old but I didn't see this issue as part of the fixes for the new version.

    I was able to reproduce this by using the SliderCellType example that comes with the v4.0.3510 examplesCS solution. All I did was change a few lines of code in Form1.cs:

     

    private void menuItem7_Click(object sender, System.EventArgs e)

    {

    FarPoint.Win.Spread.CellType.SliderCellType slider = new FarPoint.Win.Spread.CellType.SliderCellType();
    slider.Orientation = FarPoint.Win.SliderOrientation.VerticalBottomToTop; // Bug only seems to appear when the orientation is VerticalBottomToTop.

    slider.Maximum = 25; // Arbitrary positive maximum

    slider.Minimum = -100; // As long as the minimum is negative, the slider hotspot will be offset by that many pixels.

    fpSpread1.ActiveSheet.Cells[0, 0].CellType = slider;

    }

     

    Once you've made the above changes, run the example. menuItem7 is the Minimum/Maximum property option so choose that from the menu to trigger the bug. It might be easier to resize the row with the slider to give you a bit more room. If you know of an easy quickfix, that'd be great but since I need this fixed today, I'm likely going to end up switching to using a Windows TrackBar in the cell instead.

  • Posted 8 September 2017, 5:06 am EST

    Hello,

    It doesn't look like a bug to me, still I have forwarded this issue to the concerned team for further observation. I will update you as soon as I get any information about this.

     

    Thanks,

     

  • Posted 8 September 2017, 5:06 am EST

    Hello,

    After discussion with the concerned team I have reported this issue as a bug to the QA team(Bug Number: 27161). This should be fixed in the next maintenance release of Spread for Windows Forms.

    Thanks,

     

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels