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

GGC customized group / group drop area

Thread ID:





61880 Jun 4,2007 02:49 PM UTC Jun 5,2007 12:38 PM UTC WinForms 2
Tags: GridControl
Christoph Gasser
Asked On June 4, 2007 02:49 PM UTC

I've implemented a customized group and when I load the form the grid is grouping perfectly fine. But when I remove the grouping (draging from the group drop area) and try to group on the specified column again the grid is grouping by default not by my customized group.

Any idea where I can define the customized group to be used everytime the grid is grouped by that column?


Rajagopal [Syncfusion]
Replied On June 4, 2007 11:04 PM UTC

Hi Christoph,

In the TableDescriptor.GroupedColumns.Changed event, you can add your custom categorizer object to the SortColumnDescriptor. To create custom Categorizer objects, you define classes that implement ICategorizer. When you do this, whenever you group a specfic column it will be custom grouped.

Please refer this forum thread for a sample application

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


Christoph Gasser
Replied On June 5, 2007 12:38 PM UTC

Thank you for your help!

If anybody has the same problem, here is my solution (perhaps it helps somebody):

I've created a "helper class" (attached file) that is handling the grouping (date grouping like outlook).

In the initialisation part of the form's code I've the following lines od code:

this.ggc1.TableDescriptor.GroupedColumns.Changed += new Syncfusion.Collections.ListPropertyChangedEventHandler(GroupedColumns_Changed);

Then I've added the following parts:

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

private void CustomizedGridGrouping(string column)
Syncfusion.Grouping.SortColumnDescriptor cd = new Syncfusion.Grouping.SortColumnDescriptor(column, ListSortDirection.Descending);
cd.Categorizer = new GridGroupingHelper.GridGroupingHelper_Categorizer();
//cd.Comparer = new GridGroupingHelper.GridGroupingHelper_Comparer();
if (this.ggc1.TableDescriptor.GroupedColumns.Contains(column))
this.ggc1.QueryCellStyleInfo += new Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventHandler(CustomizedGridGrouping_Format);

private void CustomizedGridGrouping_Format(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e)
if (e.TableCellIdentity.GroupedColumn != null && e.TableCellIdentity.DisplayElement.ParentGroup != null
&& e.TableCellIdentity.DisplayElement.ParentGroup.Category is int
if (e.TableCellIdentity.DisplayElement is CaptionRow
&& e.TableCellIdentity.GroupedColumn.Name == "ColumnName")
e.Style.CellValue = String.Format("{0}: {1} {2}", (string)GridGroupingHelper.GridGroupingHelper_Format.ColumnLabelByDateGroup((int)e.TableCellIdentity.DisplayElement.ParentGroup.Category), e.TableCellIdentity.DisplayElement.ParentGroup.GetChildCount(), "YourText");
if (this.ggc1.Table.Records.Count > 0)
this.ggc1.Table.Records[0].ParentGroup.IsExpanded = true;

Hope this helps anybody.



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