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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How do I perform multicolumn sorting in a GridDataBoundGrid?

Platform: WinForms |
Control: GridDataBoundGrid(Classic)


In a GridDataBoundGrid, you can sort a columns by either clicking or double-clicking the column headers. By default it supports sort a single column. In this section, we provide a sample that contains a SortHelper class that you can include in any projects to facilitate multicolumn sorting. This helper class requires your datasource to be a DataTable (or DataView or DataSet+TableName).

User can sort columns by clicking the header cells just as before, and also if the user perform ctl+clicks, the sorting will retain current sort order for any column that is already sorted. In this manner, the user can do multicolumn sorts. There is also an API call in the SortHelper class that allows you to programmatically sort multiple columns from code.


private GridMultiColSortHelper sortHelper = null;

private void Form1_Load(object sender, System.EventArgs e)


//create and wire the sorthelper object

sortHelper = new GridMultiColSortHelper();

sortHelper.WireGrid(this.gridDataBoundGrid1, true); //true indicate teh helper will resize to fit column headers



Private sortHelper As GridMultiColSortHelper = Nothing

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load

'create and wire the sorthelper object

sortHelper = New GridMultiColSortHelper

sortHelper.WireGrid(Me.gridDataBoundGrid1, True) 'true indicate teh helper will resize to fit column headers

End Sub 'Form1_Load

Here is the link with both CS and VB samples: http://websamples.syncfusion.com/samples/kb/grid.windows/GDBGMultiSort/main.htm

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

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

Up arrow icon

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

Live Chat Icon For mobile