wpf-9700-controls-and-libraries-data-grid-display-hierarchical-data.md
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
|
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.
The image below illustrates how the TreeListView generates a tree based on Key-Parent pairs:
Tip
Topic : Binding to Self-Referential Data Structure
A hierarchical data structure is a set of nested objects where a children field contains child records. Parents and children can be of different object types.
The DataControlBase.ItemsSource property contains only data items that correspond to root nodes. Use the following approaches to make the TreeListView work with the hierarchical data structure:
Tip