[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
 [Expand]What's Installed
 [Expand].NET Core 3 Support
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
  [Collapse]Data Grid
   [Expand]Getting Started
   [Expand]Implementation Details
   [Collapse]Grid View Data Layout
    [Expand]Columns and Card Fields
    [Expand]Rows and Cards
      Nodes Overview
      Iterate Through Nodes
      Expand and Collapse Nodes
      Obtain Nodes
      Check Nodes
      Sort Nodes
      Filter Nodes
      Move Nodes
     Data Cells
     Best Fit
     Compact Mode
   [Expand]Binding to Data
   [Expand]Master-Detail Data Representation
   [Expand]Data Editing and Validation
   [Expand]Filtering and Searching
   [Expand]Data Summaries
   [Expand]Paging and Scrolling
   [Expand]Focus, Navigation, Selection
   [Expand]Conditional Formatting
   [Expand]Appearance Customization
   [Expand]MVVM Enhancements
   [Expand]Printing and Exporting
   [Expand]End-User Interaction
   [Expand]Performance Improvement
   [Expand]Design-Time Features
   [Expand]Visual Elements
   [Expand]End-User Capabilities
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Nodes Overview

Nodes correspond to records in a data source and are represented by TreeListNode objects.

Nodes are stored as nested collections because the TreeListView displays data in a tree. The collection of root level nodes can be accessed via the TreeListView.Nodes property. Each node has its own collection of child nodes available via the TreeListNode.Nodes property. These child nodes have their own children, etc.

In a bound mode, nodes are created automatically for every record in a data source. In an unbound mode, you need to create nodes manually.

Expanded Node Elements

A node includes the following elements.

  • Data Cell(s)

    The number of data cells depends on the number of visible columns (TreeListView.VisibleColumns).

  • Indent(s)

    Indents specify an offset by which data cells are horizontally shifted to the right (to the left if RTL orientation is used). This is required to indicate nesting levels, display expand buttons and images. An indent is specified by the TreeListView.RowIndent property in pixels. The number of indents that specify the offset depends on the node's nesting level, whether the expand button and image are required to be displayed. For example, in the image above the root node has two indents that specify the offset of its data cells. First level nodes contain three indents, etc.

  • Expand Button

    A node displays the expand button if it has child nodes. To manually specify the expand button's visibility, use the TreeListNode.IsExpandButtonVisible property.

  • Checkbox

    A checkbox allows an end-user to Check Nodes. Embedded check boxes can be bound to a Boolean field in the grid's data source via the TreeListView.CheckBoxFieldName property. Enable the TreeListView.ShowCheckboxes option to display check boxes embedded into nodes.

  • Image

    Node images can be explicitly specified using the TreeListNode.Image property or automatically obtained from the field in a data source with long binary data (its name is specified by the TreeListView.ImageFieldName property). To allow displaying node images, enable the TreeListView.ShowNodeImages option.

The image below shows node elements:

Expanded Root Nodes

Root nodes do not have parent nodes. The parent value of a root node does not point to a key value of any other node. Root nodes are contained within the TreeListView.Nodes collection.

Use the TreeListView.RootValue property to explicitly specify the root value (for instance, to build a tree from the specified hierarchy level). Once this property is specified (by default, it is set to null), the collection of root nodes contains only those nodes whose parent values equal to the root value. Nodes whose parent values do not point to any other node are ignored and not displayed within a tree.

The following example demonstrates how to modify the tree shown above to display data from the specified hierarchy level. To do this, the TreeListView.RootValue property is set to 1. Since the service fields store integer values, the type of the value assigned to this property, must also be integer.

The image below shows the result.

Expanded Concepts

Expanded Examples

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