Back to Devexpress

TreeList.SetNodeCheckState(TreeListNode, CheckState, Boolean) Method

windowsforms-devexpress-dot-xtratreelist-dot-treelist-dot-setnodecheckstate-x28-devexpress-dot-xtratreelist-dot-nodes-dot-treelistnode-system-dot-windows-dot-forms-dot-checkstate-system-dot-boolean-x29.md

latest3.4 KB
Original Source

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.v25.2.dll

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

Declaration

csharp
public void SetNodeCheckState(
    TreeListNode node,
    CheckState state,
    bool recursive
)
vb
Public Sub SetNodeCheckState(
    node As TreeListNode,
    state As CheckState,
    recursive As Boolean
)

Parameters

NameTypeDescription
nodeTreeListNode

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.

  • 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.

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

See Also

Node Checking - Checkboxes and Radio Buttons

TreeList Class

TreeList Members

DevExpress.XtraTreeList Namespace