select

TreeView / Declarative DataSources

Rate this demo: Feedback
Run example in: C# VB.NET Change Skin:
Vista
  • BlackBlack
  • DefaultDefault
  • ForestForest
  • HayHay
  • Office2007Office2007
  • OutlookOutlook
  • SimpleSimple
  • SitefinitySitefinity
  • SunsetSunset
  • TelerikTelerik
  • VistaVista
  • Web20Web20
  • WebBlueWebBlue
  • Windows7Windows7
  • XmlDataSource
    • All
      • Products
        • ASP.NET AJAX Controls
        • WinForms Controls
        • WPF Controls
        • Silverlight Controls
        • Telerik Reporting
        • Telerik OpenAccess ORM
        • Sitefinity ASP.NET CMS
        • WebUI Test Studio
      • Consulting
        • On-site Training
        • Consulting Express
        • Open Classes Training
        • Online Training
        • Project Consulting
        • Telerik Webinars
      • Purchase
        • Buy Now
        • Renewals & Upgrades
        • License Agreement
        • FAQ
        • Purchase Orders
        • Contact Sales
      • Support
        • Support by Product
        • Documentation
        • Demos
        • Knowledge Base
        • Telerik Trainer
        • Videos
        • Skins
      • Community
        • Forums
        • Blogs
        • Events
        • Code Library
        • Learning Resources
        • Announcements
        • Free Products
      • Company
        • About Telerik
        • Press Center
        • Careers
        • Contact Us
  • ObjectDataSource
    • RadControls for ASP.NET Ajax
      • RadGrid
      • RadScheduler
      • RadEditor
    • RadControls for Silverlight
      • RadGrid
      • RadMenu
      • RadEditor
  • SqlDataSource
    • Fuller
      • Davolio
      • Leverling
      • Peacock
      • Buchanan
        • Suyama
        • King
        • Dodsworth
      • Callahan

Example Source Code & Description

Instructions
Open in new window
  • RadTreeView supports binding to various types of data sources, including declarative datasources.

    Some of the declarative data sources are inherently hierarchical. These include SiteMapDataSource and XmlDataSource. When data-bound to these types of data sources, RadTreeView automatically creates the node hierarchy. There is no need to use the DataFieldID and DataFieldParentID properties.

    The AccessDataSource is a table-based DataSource component. It can be used to bind the treeview declaratively at design time. As with binding to a DataSet, DataTable, or DataView, you can use the ID-ParentID relation to establish a hierarchy among the nodes.

    RadTreeView supports binding to an ObjectDataSource as well. In addition to the standard Node properties (Text, Value, Navigate Url, etc.) that can be bound to the underlying business objects, the DataFieldID and DataFieldParentID properties can be specified, too. In this way, RadTreeView can create a hierarchy of Nodes.

    Still, the business objects should provide the data needed for the RadTreeView to build the hierarchy. If the ParentID property of the business objects are of nullable or reference type, then null values denote root Nodes. In case, the ParentID property is of value type (Integer, Guid, etc.), '0'/'Guid.Empty' values denote the root Nodes.

    For more details on the aforementioned algorithm, please read the documentation topic - Binding to Array, ArrayList and Generic List.

Compatible with ASP.NET 2.0, 3.5 AJAX enabled Accessibility Verified!Valid XHTML 1.1! Optimized for Visual Studio 2005, 2008
Copyright 2002-2010 © Telerik. All right reserved  | 
Telerik Inc., 460 Totten Pond Rd, Suite 640, Waltham, MA 02451

www.telerik.com  |  Terms of Use  |  Contact Us