Sorting in Tree Grid Control
18 Nov 20182 minutes to read
Sorting enables you to sort data in Ascending or Descending order. To sort a column, click the column header.
To sort multiple columns, press and hold the CTRL key and click the column header. You can clear sorting of any one of the multi-sorted columns by pressing and holding the SHIFT key and clicking the specific column header.
To enable sorting in the TreeGrid, set the allowSorting property to true. Sorting options can be configured through the e-treegrid-sortsettings tag helper.
NOTE
TreeGrid columns are sorted in the Ascending order. If you click the already sorted column, the sort direction toggles.
You can apply and clear sorting by invoking sortColumn and clearSorting methods.
To disable sorting for a particular column, set theallowSortingproperty ofe-treegrid-columntag helper to false.
Initial sort
To sort at initial rendering, set the field and direction in the columns property of e-treegrid-sortsettings tag helper.
Sorting events
During the sort action, the treegrid component triggers two events. The actionBegin event triggers before the sort action starts, and the actionComplete event triggers after the sort action is completed. Using these events you can perform the needed actions.
NOTE
The args.requestType is the current action name. For example, in sorting the args.requestType value is sorting.
Touch interaction
When you tap the treegrid header on touchscreen devices, the selected column header is sorted. A popup
is displayed for multi-column sorting. To sort multiple columns, tap the popup
, and then tap the desired treegrid headers.
The following screenshot shows treegrid touch sorting.

NOTE
You can refer to our
ASP.NET Core Tree Gridfeature tour page for its groundbreaking feature representations. You can also explore our ASP.NET Core Tree Grid exampleASP.NET Core Tree Grid exampleto knows how to present and manipulate data.