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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Custom Grouping Logic in Grid

Thread ID:





67040 Aug 7,2007 10:42 PM UTC Aug 7,2007 10:52 PM UTC WinForms 1
Tags: GridControl
Jogesh Menon
Asked On August 7, 2007 10:42 PM UTC


I wanted to know if we can use some custom logic when grouping in the Grid. For example right now when we drap the column header it groups on distinct values.

But what I am looking for is, say when a particular column is dragged , I use custom grouping logic (example: for numeric fields create bands like 1-10, 10-20, 30-40).

Is it possible for me to get handle to the grouping engine and data source of the grid?

Do you guys have any examples that could help me out.


haneefm [Syncfusion]
Replied On August 7, 2007 10:52 PM UTC

Hi Jogesh,

One way you can do this by adding your own custom Categorizer object to the SortColumnDescriptor. Once the column is grouped, the custom Categorizer is used to determine which adjacent records in the column belong to the same group. To create custom Categorizer objects, you define classes that implement ICategorizer (two methods). Please refer to the atttached sample and let me know if this helps.

private void GroupedColumns_Changed(object sender, Syncfusion.Collections.ListPropertyChangedEventArgs e)
if( e.Action == Syncfusion.Collections.ListPropertyChangedType.Insert)
SortColumnDescriptor column = e.Item as SortColumnDescriptor;
if( column.Name == "DateTime")
column.Categorizer = new CustomCategorizer();

Sample : CustomizedGrouping.zip

Also, check this knowledgebase article that shows you "How to create custom group in a GridGroupingControl?".

Best regards,


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

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

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