Skip to main content

TreeList.SetNodeCheckState(TreeListNode, CheckState, Boolean) Method

Sets the node’s check state. Allows you to set the check state for child and parent (if all child nodes are checked or unchecked) nodes.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v23.2.dll

NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.TreeList

Declaration

public void SetNodeCheckState(
    TreeListNode node,
    CheckState state,
    bool recursive
)

Parameters

Name Type Description
node TreeListNode

A TreeListNode object whose check state is to be changed.

state CheckState

A CheckState enumeration value that specifies the check state.

recursive Boolean

true to set the check state of child and parent nodes; otherwise, false.

Remarks

The node checking feature is controlled by the TreeListOptionsView.CheckBoxStyle, TreeListOptionsView.RootCheckBoxStyle and TreeListNode.ChildrenCheckBoxStyle properties.

TreeList nodes can display radio buttons instead of regular check boxes. Radio buttons are mutually exclusive options. If any radio button is checked and you select another sibling radio button, the former radio button is automatically deactivated.

The SetNodeCheckState method’s behavior is as follows when you enable recursive node checking and the target node’s children display radio buttons:

  • If no radio button is checked at a specific tree level, TreeList checks the first radio button and all its children.

    The check states of other sibling nodes and their children are not modified.

  • If any radio button is checked at a specific tree level, TreeList retains the checked state for this button and then checks all its children.

    The check states of other sibling nodes and their children are not modified.

See Node Checking - Checkboxes and Radio Buttons to learn more.

See Also