Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TreeViewControl.NodeCheckStateChanged Event

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

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v24.2.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