sort multiple columns in datagrid - DataForm.NET Sample

This example shows how to set default sorting on each column. And user can still click the title of column in GridForm to change the sorting at runtime.

Pick a Theme:

Order Details 
 Order ID AscendingProduct IDProduct NameUnit PriceQuantityDiscount  
1024842Singaporean Hokkien Fried Mee9.8000100.00 %
1024914Tofu18.6000920.00 %
1024951Manjimup Dried Apples42.4000400.00 %
1 - 3 / 2149 RecordsPage / 717 

  Design   Source  
  1. Open DataForm.NET Manager. In DataForm.NET List page, choose Order Details by clicking the link.
  2. In the DataForm.NET Designer at the right hand side, switch to GridForm tab. The Allow Sorting checkbox means whether or not users can sort the data by clicking the header of the column.
  3. Click OrderID hyperlink to open up GridForm Fields Designer window. Order By attribute specifies the initial sorting of each column. User can change the sorting by clicking the header of column if Allow Sorting checkbox is checked on. In this example, Order By attribute is set to Ascend.
  4. When user clicks on the multiple column headers, the data is resorted by all clicked columns..
  • Click HERE to open up a READ ONLY DataForm.NET Manager.
  • Click HERE to try for yourself.