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.

GGC: Sort by multiple columns

Thread ID:

Created:

Updated:

Platform:

Replies:

68841 Oct 3,2007 06:14 AM Oct 3,2007 01:03 PM Windows Forms 1
loading
Tags: Grouping
Patrick Cheng
Asked On October 3, 2007 06:14 AM

Hi,

What I want to accomplish is sorting by multiple columns. It seems that when I sort a ggc, it is only based on a specific column. That column is the column that I click the header of. I want to be able to sort based on multiple columns, one after another. Is this possible? If so, can you please provide an example?

Thank you.

haneefm [Syncfusion]
Replied On October 3, 2007 01:03 PM

Hi Patrick,


By default the multi column sort by Ctrl+Left Button Mouse Click is enabled. To enable/disable the multi column sort the AllowMultiColumnSort property must be set to true/false. Below is a code.

this.gridGroupingControl1.TableOptions.AllowMultiColumnSort = false;
From code to sort several columns, you add the columns the grid.TableDescriptor.SortedColumns collection.

this.gridGroupingControl1.TableDescriptor.SortedColumns.AddRange( new SortColumnDescriptor[ ]
{
new SortColumnDescriptor(colName1, ListSortDirection.Ascending),
new SortColumnDescriptor(colName2, ListSortDirection.Descending),
new SortColumnDescriptor(colName3, ListSortDirection.Ascending)
});

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.

;