We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to apply the Custom Grouping while grouping the column using GroupDropArea?

Platform: UWP |
Control: SfDataGrid |
Published Date: January 25, 2016 |
Last Revised Date: February 5, 2016 |
.NET Framework: 4.5
Tags: grouping

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.

C# (Converter)

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.

G:\Serialization KB\Custom Grouping\After.PNG

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.

G:\Serialization KB\Custom Grouping\Before.PNG

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.



Sample Links







2X faster development

The ultimate UWP UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon