In SfDataGrid, group represents the collection of records that belongs to a particular category. By default the grouping is applied based on the similar data in the Grid but you can customize the grouping by using your own grouping criteria. The Custom Grouping is achieved by assigning GroupColumnDescription converter in XAML or code behind. You can assign a converter that implements IValueConverter with the Custom Grouping logic.
The following code example demonstrates you how to use the converter for Custom Grouping.
The following code example demonstrates you how to add the Custom Grouping by using above converter in XAML.
The following code example demonstrates you how to add the Custom Grouping by using above converter in Code behind.
The following screenshot shows the Custom Grouping in Grid after assigning the converter in XAML or Code Behind.
But when you group the column into GroupDropArea by drag and drop, the default grouping is only applied. Because, GroupColumnDescription is added internally for this case.
The following screenshot shows you the default grouping while drag and drop the same Date column into GroupDropArea.
To achieve Custom Grouping while drag and drop the column, you need to assign the Converter with custom group logic for specific GroupColumnDescripion in GroupDescriptionsCollectionChanged event. After applying the converter to GroupColumnDescripion, the default grouping is not applied for that column and the Custom Grouping is applied.
The following code example demonstrates you how to assign the converter to GroupColumnDescription in GroupDescriptionsCollectionChanged event.
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:||.NET Framework:|
or the page will be automatically redirected to sign-in page in 10 seconds.