We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

UpdateScrollBars bug

I've recently come across what appears to be a bug in the Essential GridControl class. We're using a virtual grid setup, with data that is changing, said change events being fed to the form, which executes: ctlGrid.EndEdit(); ctlGrid.ResetVolatileData(); ctlGrid.UpdateScrollBars(); ctlGrid.Invalidate(); In this particular case, the grid is about 8 rows high, including the header. I feed it a datatable with 24 rows, which is displays properly. After scrolling to the bottom, I switch it to one with a single row. This brings (in debug mode): A first chance exception of type 'System.ArgumentException' occurred in system.windows.forms.dll Additional information: '18' is not a valid value for 'value'. 'value' should be between 'minimum' and 'maximum'. Continuing afterward, and switching back to the 24-row dataset brings up a lack of scroll bar sliders. Here's a copy of the call stack resulting from the call to UpdateScrollBars, during the switch to the single-row dataset. The value of 18 is also the row number of the first row under the header. system.windows.forms.dll!System.Windows.Forms.ScrollBar::set_Value(__int32 value = 18) + 0xda bytes syncfusion.shared.dll!Syncfusion.Windows.Forms.ReflectScrollBar::set_Value(__int32 value = 18) + 0x25 bytes syncfusion.shared.dll!Syncfusion.Windows.Forms.ScrollBarWrapper::set_Value(__int32 value = 18) + 0x2b bytes syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridScroll::UpdateScrollbars(bool bRedraw = true, bool bOnlyIfDimensionChanged = false) + 0x8d2 bytes syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridScroll::UpdateScrollbars() + 0x16 bytes syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridControlBase::UpdateScrollBars() + 0x1c bytes

4 Replies

KF Keith Farmer December 10, 2002 03:30 PM

FYI: I attempted Refresh() as follows, with no effect: > ctlGrid.EndEdit(); > ctlGrid.ResetVolatileData(); ctlGrid.Refresh(); > ctlGrid.UpdateScrollBars(); > ctlGrid.Invalidate();


AD Administrator Syncfusion Team December 10, 2002 03:36 PM

Hi Keith, do you have a sample project that lets us reproduce the problem? Please open a support incident and post it there. It might also be that you do something in a way the grid does not expect it ... Are you using version 1.5.1.1? Thanks, Stefan


KF Keith Farmer December 10, 2002 03:51 PM

I am using 1.5.1.1. I'll have to try to cobble up a sample project when I have some time, since the system this form is part of is just a bit confidential. Thinking of work-arounds, I browsed the namespace and didn't notice anything to get the current scrollbar position (which I could hopefully adjust before the UpdateScrollBars() call). Did I overlook it? Thanks for your help.


AD Administrator Syncfusion Team December 10, 2002 04:34 PM

The VScrollBar and HScrollBar properties give you access to Value, Minimum and Maximum properties of the scrollbars. Stefan

Loader.
Live Chat Icon For mobile
Up arrow icon