We have a scenario where a grid is used for a longer period of time, and the data is often changed (replaced) with new content. This is achieved by the ItemsSource being bound to a property which is changed. All of this works fine, except one small detail... All the groups are being collapsed when the ItemsSource-bound property is changed. :( This is even though we have set both PersistGroupsExpandState=True and IsGroupsExpanded=True on the grid.
I tried changing the ItemsSource to not be replaced entirely, but instead be an ObservableCollection which we Clear() and then add the items to. This had the exact same (incorrect) behavior.
Now, I can work around this by handling ItemsSource being changed, but clearly - isn't this an incorrect behavior in the grid? I feel that it shouldn't start collapsing things like this, just because the data it's bound to changes...
RGRajasekar G Syncfusion Team June 20, 2013 07:25 PM UTC
you for contacting Syncfusion support.
method present in the GridDataTable is used to expand the groups present in the
GridDataControl. GridDataControl contain event for each action. In this
scenorio we have to use the ItemsSourceChanged event like below code snippet to
expand the Groups while changing ItemsSource.
+= new Syncfusion.Windows.ComponentModel.GridRoutedEventHandler(gridDataControl_ItemsSourceChanged);