Skip to main content
A newer version of this page is available. .

TreeList.SetNodeCheckState(TreeListNode, CheckState, Boolean) Method

Sets the node’s check state to the specified value. Allows you to set the check state for the node’s children.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v18.2.dll

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 value that specifies the node’s new check state.

recursive Boolean

true, to set the check state of the node’s children to the specified value; 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