Back to Devexpress

TreeListNode.Data Property

windowsforms-devexpress-dot-xtratreelist-dot-nodes-dot-treelistnode-de8664ad.md

latest2.3 KB
Original Source

TreeListNode.Data Property

OBSOLETE

You should use the 'Tag' property instead of 'Data'

Gets or sets a value that can be freely used as your specific programming needs dictate.

Namespace : DevExpress.XtraTreeList.Nodes

Assembly : DevExpress.XtraTreeList.v25.2.dll

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

Declaration

csharp
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("You should use the 'Tag' property instead of 'Data'")]
public object Data { get; set; }
vb
<EditorBrowsable(EditorBrowsableState.Never)>
<Browsable(False)>
<Obsolete("You should use the 'Tag' property instead of 'Data'")>
Public Property Data As Object

Property Value

TypeDescription
Object

A value of the object type bound to the current 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.

csharp
bool oddRow = false;
for(int i = 0; i < treeList1.Nodes.Count; i++) {
   treeList1.Nodes[i].Tag = oddRow;
   oddRow = ! oddRow;
}
vb
Dim oddRow As Boolean = False
Dim I As Integer
For I = 0 To TreeList1.Nodes.Count - 1
   TreeList1.Nodes(I).Tag = oddRow
   oddRow = Not oddRow
Next

See Also

Tag

TreeListNode Class

TreeListNode Members

DevExpress.XtraTreeList.Nodes Namespace