Skip to main content

Binding to Self-Referential Data Structure

Since the TreeListView is designed to display information in a tree, its data source should meet certain requirements. To build a tree, the data source should contain two special fields.

  • Key Field

    This field must contain unique values used to identify nodes. Its name should be assigned to the TreeListView.KeyFieldName property.

  • Parent Field

    This field must contain values that indicate parent nodes. Its name should be assigned to the TreeListView.ParentFieldName property.

Columns bound to these fields are called service columns. By default, service columns are not created. To automatically create these columns, enable the TreeListView.AutoPopulateServiceColumns option.

NOTE

In this mode, you must specify the TreeListView.RootValue property.

NOTE

The data types of the TreeListView.RootValue and data source fields specified by the TreeListView.KeyFieldName and TreeListView.ParentFieldName properties must be the same. These values (key and parent) cannot be equal for a node.

To learn more, see Tree Generation Algorithm.

#Example: Connecting to a Data Source with Hierarchical Data