WebGrid introduces a new setting in SelfReferenceSettings object called ApplyChildSorting.
This feature instructs WebGrid to perform sorting on the self referencing child
when the column sorting action occurred.
In this topic, you will learn how to sort Self-Referencing Child data.
To sort Self-Referencing Child data
- Create Self-Reference WebGrid.
- Open WebGrid Designer and go to Advanced tab.
- Select RootTable and click See all properties.
- Expand SelfReferencingSettings and set ApplyChildSorting
to True.
- Expand RootTable and Select SortColumns.
- Add a column and set ColumnMember to EmployeeID
and SortOrder to Ascending.
- Run the project.