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

griddataboundgrid sort

Thread ID:





94222 Apr 29,2010 08:45 PM UTC May 15,2010 10:38 AM UTC WinForms 2
Tags: GridControl
Santosh Kandhukuri
Asked On April 29, 2010 08:45 PM UTC

When i click on a column the griddataboundgrid should sort by that particular column.

Santosh Kandhukuri
Replied On April 29, 2010 09:57 PM UTC

I tried this example

This example didnt work for me. I am unable to double click the header at all.

Christopher Issac Sunder K [Syncfusion]
Replied On May 15, 2010 10:38 AM UTC

Hi Santosh,

We appreciate your interest in Syncfusion products.

You can try the given sample which illustrates the CellClick event as well as CellDoubleClick event in GridDataBoundGrid Sorting. You can also make use of manual sorting instead of setting the gridDataBoundGrid1.SortBehavior by handling the DataTable directly through DataView with the following code.

void gridDataBoundGrid1_CellClick(object sender, GridCellClickEventArgs e)
if ((e.ColIndex == 1 || e.ColIndex == 3)
&& e.RowIndex == 0)
int filed = this.gridDataBoundGrid1.Binder.ColIndexToField(e.ColIndex);
string name = this.gridDataBoundGrid1.Binder.InternalColumns[filed].MappingName;
string sort = myDataTable.DefaultView.Sort.Contains(name) ? (myDataTable.DefaultView.Sort.Contains("ASC") ? "DESC" : "") : "ASC";
if (sort.Length > 0)
myDataTable.DefaultView.Sort = "[" + name + "] " + sort;
myDataTable.DefaultView.Sort = String.Empty;
e.Cancel = true;

Suppose, If you need to sort the Column with double click, you can make a try with the following code snippet.

this.gridDataBoundGrid1.SortBehavior = GridSortBehavior.DoubleClick;

And to capture the double click on the cell, you can use the CurrentCellControlDoubleClick event instead of CellDoubleClick event.

Please refer the following sample link which illustrates the behavior of CellClick, CellDoubleClick and CurrentCellControlDoubleClick in GridDataBoundGrid.


Let me know if you have any further concerns.

Christopher K.


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