The TreeView allows the user to select a single node or multiple nodes.
To enable the selection, apply the built-in
SelectDirective directive. It accepts the
kendoTreeViewSelectable property, which enables you to control the built-in selection behavior, and both
If you use a
SelectableSettings parameter, the TreeView enables you to specify the following options:
enabled—Determines if the selection is initially enabled. The default value is
SelectionModeof the selection. The default value is
By default, the
SelectDirective persists the selected item by utilizing its hierarchical index. To select a specific TreeView item by its hierarchical index, use the
You can also persist the single selection state by an item field—for example, a
text field. To select a specific TreeView item by a unique field, use the
To enable the multiple selection mode, use the
kendoTreeViewSelectable property which sets the
mode field to
By default, the
SelectDirective persists the selected items by their hierarchical index. To display initially selected TreeView items, use the
selectedKeys property and pass a list of hierarchical indices.
Similar to the single selection mode, you can also persist the multiple selection state by an item field—for example, a
text field. To select TreeView items by a unique field, use the
When the user modifies the selection, the TreeView emits the
selectionChange event. It contains the following information:
index—The index of the affected TreeView item.
dataItem—The data item of the selected TreeView item.
You can also render a specific item as selected by collecting the provided information and using the