WebGrid provides feature to sort column initially from designer.
In this topic, you will learn how to sort column initially.
To sort column initially
- Bind WebGrid
to AccessDataSource (Using Customers table from NorthWind data source).
- Right click on WebGrid and choose WebGrid Designer.
- Select Allow Sorting in Popular Settings section.
- Go to Advanced Tab. Expand RootTable >>
SortColumns.
- Add a column. Set ColumnMember to ContactName
and SortOrder to Ascending.
- Run the project and WebGrid will sort ContactName column initially.