Skip to main content
A newer version of this page is available. .

Checking Nodes

  • 2 minutes to read

Nodes can display check boxes that allow an end-user to check/uncheck individual nodes. Embedded check boxes can be bound to a Boolean field in the grid’s data source via the TreeListView.CheckBoxFieldName property.

DXGrid-Node-Check-Boxes

Enable the TreeListView.ShowCheckboxes option to display check boxes embedded into nodes.

To check all nodes in code, use the TreeListView.CheckAllNodes method. To uncheck all nodes, use the TreeListView.UncheckAllNodes method. Each time a node’s check state is changed, the TreeList View fires the TreeListView.NodeCheckStateChanged event. Use its TreeListNode.IsChecked property to identify whether a node is checked.

Recursive Node Checking

If the TreeListView.AllowRecursiveNodeChecking property is set to true, selecting a parent node automatically selects all its children. Vice versa, selecting all child nodes automatically selects its parent node(s). When an end-user unchecks a child node, the parent node is set to undetermined check state.

RecursiveNodeSelection

When the TreeListView.AllowRecursiveNodeChecking option is enabled, the TreeListRowData.IsChecked property returns the following values:

  • true - if all child nodes are checked
  • false - if none of child nodes are checked
  • null - if a current node contains both checked and unchecked children.

Note that in this case, if you use the TreeListView.CheckBoxFieldName property to update a corresponding property in your data items, this property should be of the Nullable<Boolean> data type.