# Angular TreeList Multi-Column Sorting

The TreeList sorting feature enables you to sort the data by multiple column fields.

To sort by multiple fields, provide a [`SortSettings`](https://www.telerik.com/kendo-angular-ui/components/treelist/api/sortsettings) object to the [`sortable`](https://www.telerik.com/kendo-angular-ui/components/treelist/api/treelistcomponent#sortable) option and set the `mode` property to `multiple`.

```ts
export class AppComponent {
    public sortSettings: SortSettings = {
        mode: 'multiple'
    };
}
```

The following example demonstrates sorting the data by multiple fields.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/treelist/sorting/multi-sort/source.txt)

## Setting the Initial Sort Order

To set the initial sorting order, set the [`sort`](https://www.telerik.com/kendo-angular-ui/components/treelist/api/treelistcomponent#sort) property of the TreeList to a collection of [`SortDescriptor`](https://www.telerik.com/kendo-angular-ui/components/data-query/api/sortdescriptor) objects. The sorting direction of each field can be set to ascending or descending by configuring the [`dir`](https://www.telerik.com/kendo-angular-ui/components/data-query/api/sortdescriptor#dir) property. If `dir` is not set, the descriptor will not be processed.

```ts
export class AppComponent {
    public sort: SortDescriptor[] = [
        { field: "type", dir: "asc" },
        { field: "name", dir: "asc" }
    ];
}
```

The following example demonstrates how to set a sortable TreeList with initially applied sorting configuration.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/treelist/sorting/initial-sort/source.txt)

## Disabling the Unsorted State

By default, the TreeList allows the user to remove a field from the sort order after cycling the sort direction. To disable this behavior and ensure that the fields are always sorted, provide a [`SortSettings`](https://www.telerik.com/kendo-angular-ui/components/treelist/api/sortsettings) object to the [`sortable`](https://www.telerik.com/kendo-angular-ui/components/treelist/api/treelistcomponent#sortable) option and set the [`allowUnsort`](https://www.telerik.com/kendo-angular-ui/components/treelist/api/columnsortsettings) property to `false`.

The following example demonstrates how to disable unsorting of the Teelist.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/treelist/sorting/unsort/source.txt)

## Suggested Links

* [Automatic Sorting ](https://www.telerik.com/kendo-angular-ui/components/treelist/sorting/basics)
* [Manual Sorting](https://www.telerik.com/kendo-angular-ui/components/treelist/sorting/manual-sorting)
* [API Reference of the `TreeListComponent`](https://www.telerik.com/kendo-angular-ui/components/treelist/api/treelistcomponent)
* [API Index of the TreeList](https://www.telerik.com/kendo-angular-ui/components/treelist/api)
