Skip to main content
A newer version of this page is available. .
All docs
V20.2

TreeViewControl.NodeCheckStateChanged Event

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

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v20.2.dll

NuGet Packages: DevExpress.WindowsDesktop.Wpf.Grid.Core, 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