C1FlexGrid HoverMode: crash in empty grid with "AllowMerging=FixedOnly"

Posted by: wknauf on 23 August 2023, 3:02 am EST

    • Post Options:
    • Link

    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

  • Posted 23 August 2023, 3:57 am EST

    Hi Wolfgang,

    Thanks a lot for providing the detailed information and sample project. We could reproduce the issue on our end. We have reported it to the development team for further investigation and will let you know the updates soon.

    [Internal Tracking ID: C1WIN-30986]

    Best Regards,

    Kartik

  • Posted 4 October 2023, 8:01 am EST

    Hi Wolfgang,

    We are happy to let you know that this issue has been fixed in the latest 2023v2(620) hotfix release.

    Best Regards,

    Kartik

  • Posted 9 October 2023, 5:46 am EST

    Thanks, I can confirm that it works.

    Best regards

    Wolfgang

Need extra support?

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

Learn More

Forum Channels