Sort Demo

This sample demonstrates how to sort tables by different columns and also how to avoid sorting. The sample includes options to sort the table’s content by CustomerName, ContactName and ContactTitle.

Features:

Sorting Methods screenshot





Here is the code to sort the values by CompanyName:

                this.gridDataBoundGrid1.SortColumn(this.gridDataBoundGrid1.Binder.InternalColumns["CompanyName"].Position );  

Here is the code to avoid column sort:

                this.gridDataBoundGrid1.SortBehavior = GridSortBehavior.None;  

Here is the code to sort by single click

                this.gridDataBoundGrid1.SortBehavior = GridSortBehavior.SingleClick;