Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Collapse]Tree List
   [Expand]Product Information
   [Collapse]Feature Center
    [Collapse]Data Binding
      Bound Mode
      Tree Generation Algorithm in the Tree List
      Virtual Mode (Dynamic Data Loading) Using Events
      Virtual Mode by Binding to a Business Object
      Unbound Mode
      Unbound Columns
      Posting Data to a Connected Database in ADO.NET
    [Expand]Nodes
    [Expand]Data Editing
    [Expand]Data Presentation
    [Expand]Sorting
    [Expand]Filtering
    [Expand]Summaries
    [Expand]Appearances and Look And Feel
    [Expand]Focus, Selection and Navigation
     Formatting Cell Values
    [Expand]Miscellaneous
   [Expand]Visual Elements
   [Expand]Design-Time Features
   [Expand]Examples
   [Expand]End User Capabilities
   [Expand]Member Tables
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Tree Generation Algorithm in the Tree List

The Tree List control displays hierarchical data structures in which nodes can have other nodes as children. This topic shows how to define the parent-child relationship at data source level for Tree List controls in bound mode.

Expanded Parent-Child Relationships

The data source bound to the Tree List control requires two additional fields:

  • Key Field - This field contains unique values that identify records in the data source. Assign this field name to the TreeList.KeyFieldName property.
  • Parent Field - This field refers to a corresponding parent node's Key Field. Assign this field name to the TreeList.ParentFieldName property

The image below is an example of a data source with an ID column that contains Key Fields. The PARENTID column values are Parent Fields, which identify parent rows.

The following image shows the same data source bound to the Tree List control. The TreeList.KeyFieldName property is set to "ID" and the TreeList.ParentFieldName property to "PARENTID".

Expanded Root Nodes

Root nodes do not have parent nodes (for example, the "Corporate Headquarters" node in the image above). To identify root nodes in the data source, set their Parent Field values to 0, null or DBNull.Value. You can also use a custom Parent Field value to identify root nodes by assigning this value to the TreeList.RootValue property.

A record is also recognized as a root record if its TreeList.ParentFieldName field does not match any of the nodes' key field values and is not equal to the RootValue.

 
Related API

Expanded See Also

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