[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [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 (Tree List Level)
      Virtual Mode - Binding to a Hierarchical Business Object (Data Source Level)
      Unbound Mode
      Unbound Columns
      Posting Data to a Connected Database in ADO.NET
    [Expand]Data Editing
    [Expand]Data Presentation
    [Expand]Appearances and Look And Feel
    [Expand]Focus, Selection and Navigation
     Formatting Cell Values
   [Expand]Visual Elements
   [Expand]Design-Time Features
   [Expand]End User Capabilities
   [Expand]Member Tables
  [Expand]Gantt Control
  [Expand]Chart Control
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Sunburst 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]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)

Unbound Mode

The Tree List control supports unbound mode, where you can manually create nodes. Unbound mode implies that the TreeList.DataSource property is set to null.

Expanded Online Video

Expanded Adding Columns and Nodes in Unbound Mode

Generally you should follow the steps below when customizing a Tree List control for use in unbound mode:

  1. Create columns.

    You can create columns at design time via the Tree List Designer, or in code via the TreeList.Columns collection.

    For columns, specify the type of data via the TreeListColumn.UnboundType property.

  2. Manually create nodes.

    Nodes can be manually created at design time via the Nodes Editor. At runtime, you can create nodes via the TreeList.AppendNode method.

To create a node in unbound mode, use the TreeList.AppendNode method. The method takes a nodeData parameter, and this specifies the data used to initialize the created node cells. This parameter value can be an array of values or a DataRow object. The number and order of items in the array/DataRow object must match the number and order of Tree List columns.

See How to: Create Nodes in Unbound Mode at Design Time and How to: Create Nodes in Unbound Mode in Code, for examples of populating a Tree List control in unbound mode.

Expanded Dynamic Loading

There are two data loading approaches in unbound mode. The first approach - create all the nodes at one time (for instance, on form loading). The second approach is to create root nodes on form loading and then provide child nodes dynamically, on demand, when parent nodes are expanded. Implementation of dynamic detail loading improves application performance, and reduces the data stored in memory for each parent node.

Basic steps of implementing dynamic loading are as follows:

  1. Create root nodes in a Tree List control.

    Root nodes can be created using the TreeList.AppendNode method, for instance on the application startup.

  2. For nodes that will have children, set the TreeListNode.HasChildren property to true.

    This results in displaying the Expand Button for every node of this kind. When an end-user clicks this button, the TreeList.BeforeExpand event fires.

  3. Handle the TreeList.BeforeExpand event to create child nodes for the node being expanded.

    For child nodes, you also need to set the TreeListNode.HasChildren property to true, if these nodes have their own children.

Expanded Export and Import Data

In unbound mode, you can export nodes and their data to a stream or file in XML format, and then load it later. To export the data, use the TreeList.ExportToXml. To import the previously saved data, use the TreeList.ImportFromXml method.

For more information on exporting data, see Export and Import Data.

Expanded Working in Unbound Mode

Every time the TreeList.AppendNode method or another method that modifies the node structure is called, the Tree List control performs an update. If you perform multiple subsequent calls to these methods, multiple updates take place. For performance reasons, you can avoid superfluous updates by enclosing your code with the TreeList.BeginUnboundLoad and TreeList.EndUnboundLoad methods. In this instance, the control will be updated only once, by the EndUnboundLoad method.

The following topic refers to members that may be useful to you when performing operations on the Tree List control in unbound mode: Member Table: Unbound Mode.

Expanded Examples

Expanded See Also

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