All docs
V20.2
21.1 (EAP/Beta)
20.2
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

TreeViewControl.CanUnselectNode Event

Occurs when a user tries to unselect a node and allows you to control whether a user can unselect a particular node.

Namespace: DevExpress.Xpf.Grid

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

Declaration

public event CanUnselectNodeEventHandler CanUnselectNode

Event Data

The CanUnselectNode event's data class is DevExpress.Xpf.Grid.TreeList.CanUnselectNodeEventArgs.

Remarks

Set the TreeViewControl.SelectionMode property to the Cell/Row/MultipleRow value to use the CanUnselectNode event.

The following code sample does not allow users to unselect root nodes.

<dxg:TreeViewControl x:Name="treeview"
                     CanUnselectNode="treeview_CanUnselectNode"
                     SelectionMode="Row"/>
void treeview_CanUnselectNode(object sender, DevExpress.Xpf.Grid.TreeList.CanUnselectNodeEventArgs e) {
    e.CanUnselectNode = e.Node.Level != 0;
}

Handle the CanSelectNode event to control whether a user can select a particular node.

See Also