New to Kendo UI for Angular? Start a free 30-day trial

Custom Selection

The TreeList provides low-level hooks for implementing custom selection logic.

Setting the Selected Rows

You can control the selection state by specifying the isSelected function. The function is executed for each row or cell in the TreeList and determines whether the item will be selected.

The built-in kendoTreeListSelectable directive applies its default isSelected callback to determine which rows or cells will be selected. To override the default behavior, do not apply the directive when using a custom isSelected callback. To refresh the selected state and force re-evaluation of the isSelected callback, invoke the TreeList updateView method.

The following example demonstrates row selection with isSelected callback.

Example
View Source
Change Theme:

Setting the Selected Cells

To target specific cells, both dataItem and columnIndex can be used to determine which cells will be selected.

The following example demonstrates cell selection with isSelected callback.

Example
View Source
Change Theme:

Persist Selection in Data Items

You can effectively persist the selected state of rows in the TreeList by employing the isSelected callback and handling the selectionChange event.

The following example demonstrates how to utilize these features to maintain the selected state as a field.

Example
View Source
Change Theme: