windowsforms-devexpress-dot-xtratreelist-dot-nodes-dot-treelistnode-8a0b57d3.md
Gets or sets whether the node is checked.
Namespace : DevExpress.XtraTreeList.Nodes
Assembly : DevExpress.XtraTreeList.v25.2.dll
NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.TreeList
[Browsable(false)]
[DXCategory("Behavior")]
public virtual bool Checked { get; set; }
<Browsable(False)>
<DXCategory("Behavior")>
Public Overridable Property Checked As Boolean
| Type | Description |
|---|---|
| Boolean |
true if the node is checked; otherwise, false.
|
Use the Checked property to get/set a node’s check state when nodes can only have two check states (checked and unchecked).
If the TreeListOptionsBehavior.AllowIndeterminateCheckState property is true , a node can have three check states: checked, unchecked and indeterminate. In this instance, to get/set a node’s check state, use the TreeListNode.CheckState property.
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 snippet (auto-collected from DevExpress Examples) contains a reference to the Checked 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.
winforms-treelist-custom-check-nodes-behavior/CS/Example/TreeListCheckHelper.cs#L29
TreeListNode node = e.Node;
if(node.Checked)
node.UncheckAll();
winforms-treelist-custom-check-nodes-behavior/VB/Example/TreeListCheckHelper.vb#L27
Dim node As TreeListNode = e.Node
If node.Checked Then
node.UncheckAll()
See Also