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.

Custom Sorting

Thread ID:

Created:

Updated:

Platform:

Replies:

95944 Aug 11,2010 10:24 AM Aug 12,2010 08:10 AM Windows Forms 1
loading
Tags: GridControl
Jeff Voigt
Asked On August 11, 2010 10:24 AM

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

Jisha Joy [Syncfusion]
Replied On August 12, 2010 08:10 AM

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

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.

;