C1TrueDBGrid Inverted DataView crash on sorting

Posted by: marc.brown on 1 November 2018, 6:00 pm EST

    • Post Options:
    • Link

    Posted 1 November 2018, 6:00 pm EST

    As the title says, I’m using a C1TrueDBGrid with the DataView set to Inverted. The data source for the grid is a sortable BindingList. Clicking on a header to sort the list causes the following crash:

    System.NullReferenceException: Object reference not set to an instance of an object.
       at C1.Win.C1TrueDBGrid.InvertedView.GetRowLeft(Int32 row, Int32 offset)
       at C1.Win.C1TrueDBGrid.InvertedView.GetBottomRow()
       at C1.Win.C1TrueDBGrid.BaseGrid.View.RefreshRow(Int32 row)
       at C1.Win.C1TrueDBGrid.BaseGrid.ViewList.maybeRefreshRow(Int32 row)
       at System.ComponentModel.ListChangedEventHandler.Invoke(Object sender, ListChangedEventArgs e)
       at System.Windows.Forms.BindingSource.OnListChanged(ListChangedEventArgs e)
       at System.Windows.Forms.BindingSource.InnerList_ListChanged(Object sender, ListChangedEventArgs e)
       at System.ComponentModel.ListChangedEventHandler.Invoke(Object sender, ListChangedEventArgs e)
       at System.Windows.Forms.BindingSource.OnListChanged(ListChangedEventArgs e)
       at System.Windows.Forms.BindingSource.InnerList_ListChanged(Object sender, ListChangedEventArgs e)
       at System.ComponentModel.ListChangedEventHandler.Invoke(Object sender, ListChangedEventArgs e)
       at System.ComponentModel.BindingList`1.OnListChanged(ListChangedEventArgs e)
       at System.ComponentModel.BindingList`1.FireListChanged(ListChangedType type, Int32 index)
       at Gov.Illinois.Revenue.Common.SortableBindingList`1.ResetItems(IList`1 items)
       at Gov.Illinois.Revenue.Common.SortableBindingList`1.ApplySortCore(PropertyDescriptor prop, ListSortDirection direction)
       at C1.Win.C1TrueDBGrid.BaseGrid.Frame.SortData(C1DataColumn dc)
       at C1.Win.C1TrueDBGrid.BaseGrid.View.SortOn(Int32 col)
       at C1.Win.C1TrueDBGrid.BaseGrid.View.OnClick(Point p)
       at C1.Win.C1TrueDBGrid.Split.OnClick(Point p)
       at C1.Win.C1TrueDBGrid.BaseGrid.ViewList.OnClick(Point p)
       at C1.Win.C1TrueDBGrid.BaseGrid.Frame.doClick(EventArgs e)
       at C1.Win.C1TrueDBGrid.C1TrueDBGrid.doClick(EventArgs e)
       at C1.Win.C1TrueDBGrid.BaseGrid.Frame.OnClick(EventArgs e)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at C1.Win.C1TrueDBGrid.BaseGrid.Frame.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    

    Changing the DataView to Normal allows sorting to happen as expected (no crash). Any help would be appreciated.

  • Posted 2 November 2018, 6:18 am EST

    Hi,

    I used a SortableBindingList as DataSource of TrueDBGrid and sorting works as expected in Inverted View. Please mention the build of TrueDBGrid you’re using so I can test it against that version as well.

    Please see the attached sample and modify it so that I can replicate the issue and help you further.

    InvertedDataViewSort.zip

  • Posted 2 November 2018, 8:13 am EST

    Thanks for responding. I’ve downloaded the sample and will work on it this morning as time permits. We are currently using version 4.0.20173.282 of the TrueDBGrid. Updating right now isn’t possible because we’re too close to the end of our current development cycle; however, the plan is to update once that cycle is complete.

    I’ll get back to you again after I’ve had a chance to work with the sample.

    Thanks again!

    –Marc

Need extra support?

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

Learn More

Forum Channels