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

Avoid sorting of header rows at the time of binding of data to GGC

Thread ID:





83439 Jun 25,2009 07:18 AM UTC Jun 26,2009 06:34 AM UTC WinForms 1
Tags: GridControl
Asked On June 25, 2009 07:18 AM UTC


I am facing one problem in GridGrouping control.When i bind data to GGC, all the header row are sorted by default on the basis of GroupColumn.I don't want this default behaviour. Please help me.

Here is the code I am using to bind the GGC:

grdWbsTask.DataSource = ProjectScopeManager.ScopeSubTaskDT;
grdWbsTask.ChildGroupOptions.CaptionText = "{Category}";

GridColumnDescriptor subTaskName = new GridColumnDescriptor();
subTaskName.Name = "name";
subTaskName.MappingName = "name";
subTaskName.HeaderText = "Name";

GridColumnDescriptor constantHours = new GridColumnDescriptor();
constantHours.Name = "loe_constant_hours";
constantHours.MappingName = "loe_constant_hours";
constantHours.HeaderText = "LOE(Hours)";

When i bind data to GGC ,all header rows are sorted by default on the basis of "group" column.

Awanish Kaul


Jisha Joy [Syncfusion]
Replied On June 26, 2009 06:34 AM UTC

Hi Awanish,

Thank you for your interest in Syncfusion products.

The Grouping is followed by sorting in GridGroupingControl. This is by design. You cannot prevent sorting when the column is grouped. However, it is possible to control the sorting order by adding a custom Comparer to the SortColumnDescriptor. Here is a minimal sample to do this.

You can modify the sorting order by customizing the Comparer method in the way you want.
Here is a forum link that discusses on how to use the custom sort while grouping.

Please let me know if this helps.



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

or the page will be automatically redirected to 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