Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
   Reporting
  [Collapse]Data Grid
   [Expand]Getting Started
   [Expand]Implementation Details
   [Expand]Views
   [Expand]Grid View Data Layout
   [Collapse]Binding to Data
     Binding to Data Overview
     Binding to ICollectionView
    [Expand]Binding to any Data Source with Virtual Sources
    [Expand]Server Mode
     Instant Feedback UI Mode
    [Collapse]TreeListView Data Binding
      Binding to Hierarchical Data Overview
      Binding to Self-Referential Data Structure
      Binding to Hierarchical Data Structure
      TreeList View Unbound Mode
      Dynamic Data Loading
     Applying Data Annotations
     Unbound Columns
     Posting Data to a Connected Database
     Managing Multi-Thread Data Updates
   [Expand]Master-Detail Data Representation
   [Expand]Data Editing and Validation
   [Expand]Grouping
   [Expand]Selection
   [Expand]Filtering and Searching
   [Expand]Sorting
   [Expand]Data Summaries
   [Expand]Paging and Scrolling
   [Expand]Focus and Navigation
   [Expand]Conditional Formatting
   [Expand]Drag-and-Drop
   [Expand]Appearance Customization
   [Expand]MVVM Enhancements
   [Expand]Printing and Exporting
   [Expand]End-User Interaction
   [Expand]Miscellaneous
   [Expand]Performance Improvement
   [Expand]Design-Time Features
   [Expand]Visual Elements
   [Expand]End-User Capabilities
   [Expand]Examples
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Diagram Control
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Binding to Self-Referential Data Structure

Set the TreeListView.TreeDerivationMode to TreeDerivationMode.Selfreference to enable the self-referential mode.

To represent data in a tree structure, the data source should contain the following fields:

  • Key Field

    This field should contain unique values used to identify nodes. Assign its name to the TreeListView.KeyFieldName property.

  • Parent Field

    This field should contain values that indicate parent nodes. Assign its name to the TreeListView.ParentFieldName property.

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

Note

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

Note

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

The code sample below demonstrates an example of self-referential data structure:

Example: How to: Bind to Self-Referential Data Structure

Expanded See Also

Is this topic helpful?​​​​​​​