To select a node, users can click a checkbox next to it. Set the showCheckBoxesMode to "normal" or "selectAll" to display node checkboxes. The "selectAll" mode also enables a checkbox that selects all nodes simultaneously. If selectByClick is enabled, users can click nodes to select them.
Use the following TreeView properties to adjust selection:
Specifies whether multiple node selection is allowed.
Specifies whether nested nodes are selected together with their parent.
A data field that allows you to pre-select a node. In this demo, the data field is called selected, and it is set to true for the "Victor Norris" node (see the data source).
A function that allows you to handle selection changes. In this demo, it is used to synchronize the List with the TreeView.
The TreeView also provides the following methods to manage selection programmatically:
This demo also shows how to specify an itemTemplate for node customization. Node data is passed to the template as an argument.