Posted 23 August 2023, 3:02 am EST - Updated 23 August 2023, 3:07 am EST
I enabled the mode “Selection” in one of our grids to tests how it looks like. But the grid crashes immediately ;-):
Message: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
StackTrace:
at System.Collections.ArrayList.get_Item(Int32 index)
at C1.Win.FlexGrid.RowCollection.get_Item(Int32 index)
at C1.Win.FlexGrid.C1FlexGrid.d(Int32 A_0, Int32 A_1)
at C1.Win.FlexGrid.C1FlexGrid.UpdateHoverRange(Int32 row, Int32 col)
at a1.l(MouseEventArgs A_0)
at C1.Win.FlexGrid.C1FlexGridBase.OnMouseMove(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseMove(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at C1.Win.FlexGrid.Util.BaseControls.ScrollableControl.WndProc(Message& m)
at C1.Win.FlexGrid.C1FlexGridBase.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, WM msg, IntPtr wparam, IntPtr lparam)
Visual Studio disassembly tells me that a column is accessed with Index = “-1”:
This is a bit up the callstack:
The grid has initially 0 rows and cols, and “AllowMerging” is set to “AllowMergingEnum.FixedOnly”.
Attached is a sample.
FlexHoverModeCrash.zip
Best regards
Wolfgang