windowsforms-devexpress-dot-xtratreelist-dot-nodes-dot-treelistnode-4a581ea6.md
Gets or sets the node’s check state.
Namespace : DevExpress.XtraTreeList.Nodes
Assembly : DevExpress.XtraTreeList.v25.2.dll
NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.TreeList
[DefaultValue(CheckState.Unchecked)]
[DXCategory("Behavior")]
public virtual CheckState CheckState { get; set; }
<DefaultValue(CheckState.Unchecked)>
<DXCategory("Behavior")>
Public Overridable Property CheckState As CheckState
| Type | Default | Description |
|---|---|---|
| CheckState | Unchecked |
A CheckState enumeration value that specifies the node’s check state.
|
If the TreeListOptionsBehavior.AllowIndeterminateCheckState option is disabled, a node can have two states: checked and unchecked. In this mode, to get/set check states, use the TreeListNode.Checked property.
If the TreeListOptionsBehavior.AllowIndeterminateCheckState option is enabled, three check states are supported: checked, unchecked and indeterminate. In this instance, use the CheckState property to get/set a node’s state.
See Node Checking - Checkboxes and Radio Buttons to learn more.
The following code shows how to retrieve checked nodes using the TreeList.GetAllCheckedNodes method, and modify their values.
List<TreeListNode> list = treeList1.GetAllCheckedNodes();
foreach (TreeListNode node in list) {
decimal budget = Convert.ToDecimal(node["BUDGET"])*1.1m;
node["BUDGET"] = budget;
}
Dim list As List(Of TreeListNode) = treeList1.GetAllCheckedNodes()
For Each node As TreeListNode In list
Dim budget As Decimal = Convert.ToDecimal(node("BUDGET")) * 1.1D
node("BUDGET") = budget
Next
The following code snippets (auto-collected from DevExpress Examples) contain references to the CheckState property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
object id = item[0];
tree.FindNodeByFieldValue(dashboardItem.Metadata.ID.UniqueId, id).CheckState = CheckState.Checked;
}
winforms-treelist-custom-check-nodes-behavior/CS/Example/TreeListCheckHelper.cs#L22
foreach(TreeListNode childNode in node.Nodes)
if(childNode.CheckState == CheckState.Checked)
return true;
Dim id As Object = item(0)
tree.FindNodeByFieldValue(dashboardItem.Metadata.ID.UniqueId, id).CheckState = CheckState.Checked
Next item
winforms-treelist-custom-check-nodes-behavior/VB/Example/TreeListCheckHelper.vb#L19
For Each childNode As TreeListNode In node.Nodes
If childNode.CheckState = CheckState.Checked Then
Return True
See Also