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. Image for the cookie policy date

How to Multi-Column Sort using GridControl

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

2 Replies

AD Administrator Syncfusion Team May 29, 2005 09:47 PM

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.


AD Administrator Syncfusion Team May 29, 2005 10:34 PM

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

Loader.
Live Chat Icon For mobile
Up arrow icon