Skip to main content

TreeViewCheckMode Enum

Lists values that specify check options in the TreeView component.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

public enum TreeViewCheckMode

Members

Name Description
Disabled

Users cannot check nodes.

Multiple

Users can check multiple nodes. The component does not automatically check other nodes.

Recursive

Users can check multiple nodes. The component recursively checks all child and parent nodes.

Related API Members

The following properties accept/return TreeViewCheckMode values:

Remarks

Set the CheckMode property to Multiple or Recursive to display checkboxes in nodes. The CheckedChanged event is raised when a user changes a node’s check state.

<DxTreeView Data="@Data"
            CheckMode="TreeViewCheckMode.Recursive"
            CheckNodeByClick="true">
    <DataMappings>
        <DxTreeViewDataMapping Text="Name"
                               Key="Id"
                               ParentKey="CategoryId" />
    </DataMappings>
</DxTreeView>

Note

The following actions change the check state of all nodes, even those that do not meet the applied filter criteria:

Multiple mode allows users to check multiple nodes. Users cannot set the indeterminate state from the UI. However, if you bind the Checked property to a model’s bool? field or set this property value to null in the markup, nodes can apply the indeterminate state. States of other nodes do not affect the state of a node.

Multiple checked items

Run Demo: Checking Multiple Nodes

In Recursive mode, the component recursively checks the checked node’s child and parent nodes that are allowed to be checked (the AllowCheck property is true). The parent node’s CheckBox becomes checked if all its child nodes are checked. Otherwise, the CheckBox is in indeterminate state. Disabled nodes change their states when users check or uncheck their parents.

Recursive checking

Run Demo: Recursive Node Check Marks

Note

If a node’s Checked property is specified in a data model field or in code, its value does not apply to the corresponding parent node. In Recursive mode, the parent node’s state changes in the following cases:

  • A user changes the check state of child nodes.
  • You call the SetNodeChecked or SetNodesChecked method. A method call changes check states of the specified nodes and their parent nodes as well.

In Disabled mode, CheckBoxes are not visible. API members related to check functionality have no effect.

Checking is disabled

Refer to the following section for information about limitations with Load Child Nodes on Demand mode enabled: Limitations.

See Also