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:
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
FYI: I attempted Refresh() as follows, with no effect:
ADAdministrator Syncfusion Team December 10, 2002 03:36 PM
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 22.214.171.124?
KFKeith FarmerDecember 10, 2002 03:51 PM
I am using 126.96.36.199. 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.
ADAdministrator 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.