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.