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

Detect sort change

Thread ID:





53904 Dec 22,2006 09:15 AM UTC Dec 22,2006 12:03 PM UTC WinForms 1
Tags: GridControl
Asked On December 22, 2006 09:15 AM UTC


I want to detect sort expression change in my grid.

there are event ?

thanks ?

Administrator [Syncfusion]
Replied On December 22, 2006 12:03 PM UTC

Hi zrelli,

There is no built-in event for detecting sort changes in a DataBoundGrid. If you want to detect the sort changes in DataBoundGrid, you would have to derive the GridDataBound control and override the SortColumn Method to fire the event . Here is a code snippet to show this.

public class MyDataBoundGrid: GridDataBoundGrid
public delegate void SortDirectionChanging(object sender,EventArgs e);
public event SortDirectionChanging SortChanging;

public delegate void SortDirectionChanged(object sender,EventArgs e);
public event SortDirectionChanging SortChanged;

public MyDataBoundGrid():base(){}

public override void SortColumn(int colIndex)
base.SortColumn (colIndex);
protected void OnSortChanging(object sender,EventArgs e)
if( SortChanging != null)
protected void OnSortChanged(object sender,EventArgs e)
if( SortChanged != null)

Please refer to the attached sample for implementation.

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