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.
Syncfusion Feedback

How to Multi-Column Sort using GridControl

Thread ID:

Created:

Updated:

Platform:

Replies:

29588 May 29,2005 10:33 PM UTC May 30,2005 03:34 AM UTC Windows Forms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On May 29, 2005 10:33 PM UTC

Is there any example code on how to do multi-column sorting using the GridControl? Can it be done easily? Bob

Administrator [Syncfusion]
Replied On May 30, 2005 02:47 AM UTC

Here is a sample that has a sorthelper class for use with a GridControl. It uses Comparer classes to implement the sorting. http://www.syncfusion.com/Support/user/uploads/SortRows_a527b4f5.zip To sort on multiple columns, you would need to derive a Comparer class that compares things using your primary column. When they are equal, you need to compare your secondary columns, and so on until you run out of columns to compare or your comparison does not match.

Administrator [Syncfusion]
Replied On May 30, 2005 03:34 AM UTC

The sample above sorts rows instead of columns. Here is the same sample tweaked to sort columns, and to multiple sort column 2 and 3. http://www.syncfusion.com/Support/user/uploads/SortRows_d75819bd.zip

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.

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

;