Skip to main content
A newer version of this page is available. .

TreeListNodes.Item[Int32] Property

Obtains the TreeListNode object by a specific index in the current node collection.

Namespace: DevExpress.XtraTreeList.Nodes

Assembly: DevExpress.XtraTreeList.v19.2.dll

Declaration

public TreeListNode this[int index] { get; }

Parameters

Name Type Description
index Int32

The zero-based index of the node to locate. The index is a value between 0 and TreeListNodes.Count - 1.

Property Value

Type Description
TreeListNode

A TreeListNode child at the specified index within the node collection.

Remarks

A Tree List nodes form a hierarchy. Each node may have a collection of child nodes, represented by the TreeListNodes class. The Item indexer allows you to access a node’s immediate children. The number of immediate children is specified by the TreeListNodes.Count property.

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;
}
See Also