Nodes Overview
- 2 minutes to read
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.
#Node Elements
A node includes the following elements.
Data Cell(s)
The number of data cells depends on the number of visible columns (TreeListView.VisibleColumns).
Indent(s)
Indents specify an offset by which data cells are horizontally shifted to the right (to the left if RTL orientation is used). This is required to indicate nesting levels, as well as display expand buttons and images. An indent is specified by the TreeListView.RowIndent property in pixels. The number of indents that specify the offset depends on the node's nesting level, whether or not the expand button and image are required to be displayed. For example, in the image above the root node has two indents that specify the offset of its data cells. First level nodes contain three indents, etc.
Expand Button
A node displays the expand button if it has child nodes. To manually specify the expand button's visibility, use the TreeListNode.IsExpandButtonVisible property.
Image
Node images can be explicitly specified using the TreeListNode.Image property or automatically obtained from the field in a data source with long binary data (its name is specified by the TreeListView.ImageFieldName property). To allow display node images, enable the TreeListView.ShowNodeImages option.
The image below shows node elements.
#Concepts
- Tree Generation Algorithm
- TreeList View Unbound Mode
- Expanding and Collapsing Nodes
- Iterating Trough Nodes
- Obtaining Nodes