Basics

jqGrid for ASP.NET supports automatic and custom sorting for all datasources and all data types. Sorting is initiated by clicking on a header of column (this can be customized). By default, all grid columns are sortable. If you wish to disable sorting for a particular column, set the Sortable property of the respective column to false, e.g.

<trirand:JQGrid runat="server" ID="JQGrid1" DataSourceID="SqlDataSource1"> <Columns> <trirand:JQGridColumn Sortable="false" DataField="OrderID" /> </Columns> </trirand:JQGrid>

Sorting takes place on the server and jqGrid is updated via ajax. Only the required data is sent through the wire in optimized JSON format, so the operation is very fast.

You can control various aspects of jqGrid's sorting behavior by using the SortSettings collection, e.g.

<trirand:JQGrid runat="server" ID="JQGrid1" DataSourceID="SqlDataSource1"> <SortSettings SortAction="ClickOnHeader" SortIconsPosition="Vertical" InitialSortColumn="RequiredDate" InitialSortDirection="Asc" /> </trirand:JQGrid>



  Last Updated: 11/2/2009 | © Trirand, 2009