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.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

83439 Jun 25,2009 03:18 AM Jun 26,2009 02:34 AM Windows Forms 1
loading
Tags: GridControl
Awanish
Asked On June 25, 2009 03:18 AM

Hi,

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}";

grdWbsTask.TableDescriptor.GroupedColumns.Add("group");
GridColumnDescriptor subTaskName = new GridColumnDescriptor();
subTaskName.Name = "name";
subTaskName.MappingName = "name";
subTaskName.HeaderText = "Name";
grdWbsTask.TableDescriptor.Columns.Add(subTaskName);

GridColumnDescriptor constantHours = new GridColumnDescriptor();
constantHours.Name = "loe_constant_hours";
constantHours.MappingName = "loe_constant_hours";
constantHours.HeaderText = "LOE(Hours)";
grdWbsTask.TableDescriptor.Columns.Add(constantHours);

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


Thanks,
Awanish Kaul



GGCControl_3e96c1fb_bcc31efa.zip

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

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.
http://files.syncfusion.com/support/Grid.Windows/57240.zip

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.
http://www.syncfusion.com/Support/forums/message.aspx?MessageID=29221

Please let me know if this helps.

Regards,
Jisha

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.

;