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
  [Collapse]Site Navigation and Layout
   [Expand]Product Information
   [Expand]Form Layout
   [Expand]Menu
   [Expand]Navigation Bar
   [Expand]Page Control and Tab Control
    Panel Overview
   [Expand]Ribbon
   [Expand]Site Map Control
   [Expand]Splitter
   [Expand]Tag Cloud Control
   [Expand]Title Index
   [Collapse]TreeView
     ASPxTreeView Overview
    [Collapse]Concepts
      Node
     [Collapse]Binding to Data
       Binding to Data Overview
       Data Binding Using Mapping Properties
       Automatic Data Binding
       Using Data Binding Events
      [Expand]Unbound Mode
       Virtual Mode
      Expanding and Collapsing Nodes
      Animation Effect
      Selection
      NodeLinkMode
      Check Box Support
      Callbacks
      Templates
    [Expand]Visual Elements
    [Expand]Examples
    [Expand]Member Tables
    [Expand]ASPxTreeView - Animated Images
  [Expand]File Management
  [Expand]Multi-Use Site Controls
  [Expand]Scheduler
  [Expand]HTML Editor
  [Expand]Pivot Grid
  [Expand]Tree List
  [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]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]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Binding to Data Overview

The ASPxTreeView can be populated with node information taken from a data source. Primarily designed to be a site navigation control, the ASPxTreeView supports binding to data sources containing hierarchical data. Any object that implements the IHierarchicalEnumerable or IHierarchicalDataSource interface (e.g. SiteMapDataSource, XmlDataSource, etc.) may be used as a data source for the ASPxTreeView control.

A data source can be specified by using either of following properties of the ASPxTreeView control:

The image below demonstrates the path for binding an ASPxTreeView to an XML file.

The ASPxTreeView supports two methods to retrieve data from the specified data source. One involves manually setting the control's specific data-related properties to the data source item attribute names. The other one exploits the ASPxTreeView's ability to retrieve data automatically, given that the data source item attributes are named after the property names of an ASPxTreeView object.

Whichever way you choose, the ASPxTreeView control automatically creates the TreeViewNode objects and retrieves their property values from the corresponding items.

Additionally, the ASPxTreeView provides you with specific events related to data binding that you can handle according to your application logic (for example, modify node content style).

Expanded Concepts

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