Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]ASP.NET WebForms Controls
  [Expand]Reporting
  [Expand]Chart Control
  [Expand]Grid View
  [Expand]Card View
  [Expand]Vertical Grid
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Image and Data Browsing
  [Expand]Docking and Popups
  [Expand]Site Navigation and Layout
  [Expand]File Management
  [Expand]Multi-Use Site Controls
  [Expand]Scheduler
  [Expand]HTML Editor
  [Expand]Pivot Grid
  [Collapse]Tree List
   [Expand]Product Information
   [Collapse]Concepts
    [Collapse]Binding to Data
      Connecting the ASPxTreeList to a Data Source
      Unbound Mode
      Virtual Mode
    [Expand]Data Representation Basics
    [Expand]Data Editing
    [Expand]Data Shaping and Manipulation
     Drag and Drop
    [Expand]Focus and Navigation
     Appearance Customization
     Save and Restore Layout
    [Expand]Templates
     Toolbars
   [Expand]Visual Elements
   [Expand]Examples
   [Expand]Member Tables
  [Expand]Gauges
  [Expand]Data Editors
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]ASP.NET MVC Extensions
 [Expand]Localization
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[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

Virtual Mode

In addition to bound and unbound modes, ASPxTreeList can operate in virtual mode, which greatly reduces both the server load and start-up time when working with complex or dynamically created data. In virtual mode, a tree list is created on demand, i.e., child nodes are created and initialized when their parent node is expanded. In virtual mode, the ASPxTreeList control does not remember a collection of already created nodes, because their number might be very large. So, all nodes are created only if they are shown and you have to build the tree anew each time, from the root down to the subnodes of the last expanded node, when a user expands or collapses a node.

To implement a virtual mode for ASPxTreeList, you should handle the two following events.

You can also handle the ASPxTreeList.VirtualModeNodeCreated event, which is raised for each node after is has been created to change the required characteristics of a node.

 

Note

  • In the virtual mode, ASPxTreeList doesn't automatically create columns. Data columns should be created manually.
  • Don't add any nodes manually in the virtual mode, e.g., by using the ASPxTreeList.AppendNode method.
  • You can't get a node if it is invisible or if its parent node is collapsed, because it does not exist. Therefore, there are some limitations when you work with node selection in virtual mode:

    - Nodes which are not shown,are not selected recursively.

    - You can't get selected nodes if they are not shown. (To learn more see the How to access invisible selected nodes in the virtual mode KB article)

Expanded ASPxTreeList Virtual Events Sequence

When a virtual tree list is created for the first time, the events listed in the table below are raised.

Tree List Virtual Event Typical Use
The VirtualModeCreateChildren event fires for the root node. Assign a list of root node child nodes to the event parameter's Children property. The NodeObject property returns null (Nothing for VB).
The VirtualModeNodeCreating fires for each root node child. Set the event parameter's NodeKeyValue property to a unique value, but it must remain the same value for the entire life of the tree list. Also, set the node cell values here.

After that, a tree list with first-level nodes is displayed. When an end-user expands or collapses a node, the tree list is created anew. The events are raised in the following sequence.

Tree List Virtual Event Typical Use
The VirtualModeCreateChildren event fires for the root node. Assign a list of root node child nodes to the event parameter's Children property. The NodeObject property returns null (Nothing for VB).
The VirtualModeNodeCreating fires for each root node child. Set the event parameter's NodeKeyValue property to the same unique value as before. Also, set the cell values again.
The VirtualModeCreateChildren event fires again for the node being expanded. Assign a list of subnodes to the event parameter's Children property. The NodeObject property returns a node currently being processed.
The VirtualModeNodeCreating fires for each subnode. Set the subnode's keys and values.

Expanded Example

In this example, the ASPxTreeList uses the Virtual data binding method to display the file/folder tree. In this mode, a tree is created on demand.

The image below shows the result.

Expanded See Also

How would you rate this topic?​​​​​​​