Category / Section
How to Expand the Groups while changing the Itemsource in GridDataControl
1 min read
ExpandAllGroups method enables you to expand all groups present in GridDataControl. You need to hook the ItemsSourceChanged event to handle when ItemSource property of GridDataControl changes. You can call ExpandAllGroups method to expand all groups from ItemsSourceChange event.
C#
this.gridDataControl.ItemsSourceChanged += new Syncfusion.Windows.ComponentModel.GridRoutedEventHandler(gridDataControl_ItemsSourceChanged); void gridDataControl_ItemsSourceChanged(object sender, Syncfusion.Windows.ComponentModel.SyncfusionRoutedEventArgs args) { this.gridDataControl.Model.Table.ExpandAllGroups(); }
In another way, the value of IsGroupsExpanded property is set as ‘True’, to expand the Groups automatically while changing the Itemsource.
C#
this.gridDataControl.IsGroupsExpanded = true;