Binding to Hierarchical Data Overview
- 2 minutes to read
In data bound mode, the TreeListView can display information in a tree from a self-referential (flat) or hierarchical data structure. It provides the corresponding tree derivation mode(s), specified via the TreeListView.TreeDerivationMode property, for each type of a data structure:
Data Structure Type | Tree Derivation Mode |
---|---|
Self-Referential (Flat) | Self-Reference |
Hierarchical | Child Nodes Path Child Nodes Selector Hierarchical Data Template |
Self-Referential Data Structure
The TreeListView can display information in a tree from self-referential data structures. To build a tree structure, data source should contain two fields with the same data type.
Key Field
This field must contain unique values used to identify nodes.
Parent Field
This field must contain values that indicate parent nodes.
The image below illustrates how the TreeListView generates a tree based on Key-Parent pairs:
Topic: Binding to Self-Referential Data Structure
Hierarchical Data Structure
A hierarchical data structure is any set of nested business objects that have a structure where the children of a node are in a ‘children’ field. Parents and children can be different object types.
- ChildNodesPath - use this approach with the same object type for a child and parent fields only.
- ChildNodesSelector - create a selector class for picking fields. This approach is applicable for a different objects types.
- Hierarchical Data Templates - create a template for different data types.
Topic: Binding to Hierarchical Data Structure