Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TreeListNode.Tag Property

Gets or sets the data associated with a Tree List node.

Namespace: DevExpress.XtraTreeList.Nodes

Assembly: DevExpress.XtraTreeList.v24.2.dll

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

#Declaration

[DefaultValue(null)]
[DXCategory("Data")]
public virtual object Tag { get; set; }

#Property Value

Type Default Description
Object null

An object containing information associated with the Tree List node.

#Remarks

This property can be used to store any object that you want to associate with a node.

#Example

The following example demonstrates a way to traverse through root nodes. A Boolean value is assigned to the TreeListNode.Tag property of each visited node. Odd nodes get a true property value, while even nodes get a false value.

bool oddRow = false;
for(int i = 0; i < treeList1.Nodes.Count; i++) {
   treeList1.Nodes[i].Tag = oddRow;
   oddRow = ! oddRow;
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the Tag 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.

See Also