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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Regarding column header click sort

Thread ID:





72168 Mar 6,2008 05:20 AM UTC Mar 13,2008 11:24 AM UTC WinForms 1
Tags: Grouping
Asked On March 6, 2008 05:20 AM UTC

Hi All,

I am using GridGroupingControl, while click on grid Column header it's sorting properly and showing on the UI but problem is after sort in UI, In the datasource BindingList doesn't contain sorted list it contain old list only(which was assigned initailly before sort in UI. So it means that sort in column header click doesn't sort in underlying datasource.

Can you give please tell me how do i update underlaying datasource while sorting in UI?

Waiting for your reply...

Thanks and Regards

Administrator [Syncfusion]
Replied On March 13, 2008 11:24 AM UTC

Hi Sathishkumar,

Thank you for your interest in Syncfusion products.

To sort the underlaying datasource while sorting in UI to handle TableControlQueryAllowSortColumn and set the ApplySort method.
Please refer the code below for more details.

void TableControl_QueryAllowSortColumn(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridQueryAllowSortColumnEventArgs e)
CurrencyManager lm = this.BindingContext[this.gridGroupingControl1.DataSource] as CurrencyManager;
ListSortDirection direction=((IBindingList)lm.List).SortDirection;
if (direction == ListSortDirection.Ascending)
direction = ListSortDirection.Descending;
direction = ListSortDirection.Ascending;

if (lm.List is IBindingList && ((IBindingList)lm.List).SupportsSorting)
PropertyDescriptorCollection pdc = lm.GetItemProperties();
((IBindingList)lm.List).ApplySort(pdc[0], direction);

Please refer the attached sample for more details.


Best Regards,


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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