wpf-9615-controls-and-libraries-data-grid-grid-view-data-layout-nodes-nodes-overview.md
Nodes correspond to records in a data source and are represented by TreeListNode objects.
Nodes are stored as nested collections because the TreeListView displays data in a tree. The collection of root level nodes can be accessed via the TreeListView.Nodes property. Each node has its own collection of child nodes available via the TreeListNode.Nodes property. These child nodes have their own children, etc.
In a bound mode, nodes are created automatically for every record in a data source. In an unbound mode, you need to create nodes manually.
A node includes the following elements.
Data Cell (s)
Indent (s)
Expand Button
Checkbox
Image
The image below shows node elements:
Root nodes do not have parent nodes. The parent value of a root node does not point to a key value of any other node. Root nodes are contained within the TreeListView.Nodes collection.
Use the TreeListView.RootValue property to explicitly specify the root value (for instance, to build a tree from the specified hierarchy level). Once this property is specified (by default, it is set to null ), the collection of root nodes contains only those nodes whose parent values equal to the root value. Nodes whose parent values do not point to any other node are ignored and not displayed within a tree.
The following example demonstrates how to modify the tree shown above to display data from the specified hierarchy level. To do this, the TreeListView.RootValue property is set to 1. Since the service fields store integer values, the type of the value assigned to this property, must also be integer.
<dxg:TreeListView Name="treeListView"
KeyFieldName="ID"
ParentFieldName="ParentID">
<dxg:TreeListView.RootValue>
<sys:Int32>1</sys:Int32>
</dxg:TreeListView.RootValue>
</dxg:TreeListView>
The image below shows the result.