New to Kendo UI for AngularStart a free 30-day trial

Custom Selection

Updated on Sep 1, 2026

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

Setting the Selected Rows

You can set the selected rows by specifying the isSelected function. The function is executed for each data row in the TreeList and determines whether the row will be selected.

The built-in kendoTreeListSelectable directive applies its own 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 updateView method.

The following example demonstrates row selection with the isSelected callback.

Example
View Source
Loading ...

Setting the Selected Cells

To set the selected cells programmatically, specify the isSelected function. The function is executed for each data cell in the TreeList and determines whether the cell will be selected based on the dataItem and columnIndex values.

The following example demonstrates cell selection with the isSelected callback.

Example
View Source
Loading ...

Persisting Selection in Data Items

You can persist the selected state of rows in the TreeList by using the isSelected callback together with the selectionChange event.

The following example demonstrates how to maintain the selected state as a field on the data item.

Example
View Source
Loading ...

Disabling the Selection of Specific Elements

The TreeList automatically handles clicks made on non-focusable elements and performs selection. To disable this default behavior for custom or specific non-focusable elements, apply the k-treelist-ignore-click class.

html
<ng-template kendoTreeListCellTemplate let-dataItem>
  <div class="k-treelist-ignore-click">
    Ignored Element
  </div>
  {{ dataItem.name }}
</ng-template>

The following example prevents the row selection when clicking on the custom element displayed inside the cell.

Example
View Source
Loading ...