Hi,
This is what I am doing.
I am binding my grid to BindingList (Flat).
But when the form loads, I apply a group by column, which was saved on layout. So basicallyl, I expect the grouping to be applied at this time, but expect that no rows or very few of them present.
Then, while it is populating the grid with rows from BindingList (which I assume...)
Then, I am getting the following exception on BindingList' ListChanged Event.
(From my code, I don't have any part that tries to convert UltraGridRow from UltraGridGroupByRow', and vice versa. The below exception simply happens when the grid is being populated by rows in BindingList).
Unhandled Thread Exception, Exception='System.InvalidCastException:
Unable to cast object of type 'Infragistics.Win.UltraWinGrid.UltraGridRow' to type 'Infragistics.Win.UltraWinGrid.UltraGridGroupByRow'. at
Infragistics.Win.UltraWinGrid.RowsCollection.SyncRows_Add(UltraGridRow row, Int32 desiredIndex) at
Infragistics.Win.UltraWinGrid.RowsCollection.OnListChangedHelper(ListChangedEventArgs e, Boolean calledFromBandListChanged) at
Infragistics.Win.UltraWinGrid.RowsCollection.OnListChanged(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
OnListChanged(ListChangedEventArgs e_)
Can you please tell me what is the cause of this? And, is there a specific setting that I need to set on Grid or on BindingList?
I think that this issue has been recently fixed, though I don't think that it made it into the hotfix. If I recall correctly, the issue had to do with applying sorting/grouping and filtering at once when there was already sorting or grouping enabled (though the latter might not be true). Regardless, I'm not aware of any workaround short of applying the sorting/grouping and the filtering separately, allowing the grid to paint and reverify its rows in between the two. You should contact Developer Support to see if this issue has been resolved, and be notified of the fix.
-Matt
Hi Matt,
I am getting the same exception in a project I am working on
with a grid with multiple group by columns. However, we are not doing any filtering. We apply
all the group bys programmatically and then occasionaly the exception occurs. Where can
I check whether an upgrade to 9.1 ( we are on 7.1 at the moment) will fix the issue?
thanks
Regards
Alan
Alan,
The only case that I was aware of regarding this issue generally involved a combination of both filtering and grouping, but it's definitely possible that the fix to the original issue will address your current issue. The two options you have to test this are to either download the trial for 9.1, or to submit a sample to Developer Support and have them see if they can reproduce the problem.