Skip to main content
All docs
V24.1

TreeViewControl.NodeCheckStateChanged Event

Occurs when a node’s check box value is changed.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v24.1.dll

NuGet Package: DevExpress.Wpf.Grid.Core

Declaration

public event TreeViewNodeEventHandler NodeCheckStateChanged

Event Data

The NodeCheckStateChanged event's data class is DevExpress.Xpf.Grid.TreeList.TreeViewNodeEventArgs.

Remarks

When a node’s check state is changed, the TreeViewControl raises the NodeCheckStateChanged event. Use the TreeListNode.IsChecked property to identify whether a node is checked:

<dxg:TreeViewControl ShowCheckboxes="True"
                     NodeCheckStateChanged="treeview_NodeCheckStateChanged"
                     .../>
using DevExpress.Xpf.Grid;

void treeview_NodeCheckStateChanged(object sender, DevExpress.Xpf.Grid.TreeList.TreeViewNodeEventArgs e){
    if (e.Node.IsChecked.Value && e.Node.HasChildren){
        foreach (TreeListNode node in e.Node.Nodes){
            node.IsChecked = false;
        }
    }
}

Use the following methods to check/uncheck nodes in code:

Method Description
TreeViewControl.CheckAllNodes Checks all nodes.
TreeViewControl.UncheckAllNodes Unchecks all nodes.
TreeListNode.IsChecked Checks/unchecks the node.
See Also