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

Custom Sorting

Is it possible to keep the Sorting UI with the columns (and arrows) but to handle the actual sorting of data myself?

We have a grid that can have 80k plus records. Doing the standard sort can take upwards of 40 seconds.

However, we now use an Array to bind the data and if we custom sort the array doing an Array.Sort it takes less than a second. Our current solution is to disable sorting and have a combo box display the columns while doing our own sorting on the selection changed event.

I would like to use the Grids look and feel for the sorting (as to what is sorted) but just replace the entire sort routine w/our own Array.Sort.

I first tried to modify the SortedColumns_changing event by setting the e.Cancel = true but it STILL will do its default sorting...

Where do I start!?

Thanks,
-jv

1 Reply

JJ Jisha Joy Syncfusion Team August 12, 2010 12:10 PM UTC

Hi jv,

You could prevent the default sorting in GriddataBoundGrid by handling TableControlQueryAllowSortColumn event and setting e.AllowSort is true.


void gridGroupingControl1_TableControlQueryAllowSortColumn(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridQueryAllowSortColumnEventArgs e)
{

e.AllowSort = false;

}

Regards,
Jisha

Loader.
Live Chat Icon For mobile
Up arrow icon