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.
Unfortunately, activation email could not send to your email. Please try again.

Customized Grouping

Thread ID:

Created:

Updated:

Platform:

Replies:

57064 Feb 25,2007 05:29 PM Feb 26,2007 02:20 PM Windows Forms 1
loading
Tags: GridControl
VoxCode
Asked On February 25, 2007 05:29 PM

Hi,

My table has a System.DateTime column. When grouped by this column, I would like it to group by date only (i.e. ignore the time). I found the 'How To' article showing a custom group and it works fine but I would like to override the default behaviour when the user drags the Date comumn to grouping area. The example creates a new custom group and dragging the Date column header to group area causes the same default behaviour. How do I custome the grouping behaviour for a column?

Thanks - Joel

Administrator [Syncfusion]
Replied On February 26, 2007 02:20 PM

Hi Joel,

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

Best regards,
Haneef

CONFIRMATION

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.

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.

;