ASP.NET Tree. ExpertTree - XML and CSS based DHTML Server-Side Tree Control for ASP.NET

Examples Quick Start ExpertTree Designer Contact Us
About the demo
This demo shows how to bind ExpertTree to a XmlDataSource control and auto-populate the tree on demand.
All you need to do for this is to set tree's DataSourceID property to the ID of the XmlDataSource control and define a number of DataBindings and nested PropertyBindings to map tree nodes to data members and data fields and define PropertyBinding for PopulateOnDemand property with Value="True".
Here three DataBindings are defined for three different XML elements named Book, Chapter and Section. Every DataBinding also defines how tree node properties bind to Xml attributes. The first two levels also bind PopulateOnDemand property to True.

<DataBindings>
    <ec:DataBinding DataMember="Book">
        <PropertyBindings>
            <ec:PropertyBinding Property="Text" DataField="Title" />
            <ec:PropertyBinding Property="PopulateOnDemand" Value="True" />
        </PropertyBindings>
    </ec:DataBinding>
    <ec:DataBinding DataMember="Chapter">
        <PropertyBindings>
            <ec:PropertyBinding Property="Text" DataField="Heading" />
            <ec:PropertyBinding Property="PopulateOnDemand" Value="True" />
        </PropertyBindings>
    </ec:DataBinding>    
    <ec:DataBinding DataMember="Section">
        <PropertyBindings>
            <ec:PropertyBinding Property="Text" DataField="Heading" />
        </PropertyBindings>
    </ec:DataBinding>    
</DataBindings>

    
You can define a number of PropertyBindings to map additional node properties to other Xml attributes or assign them arbitrary values.
You can also define a handler for ItemDataBound server-side event for fine tuning the bound properties or even cancel creating the node.
PopulateOnDemandViewStateEnabled property controls whether the tree view state is kept up-to-date between server callbacks. If PopulateOnDemandViewStateEnabled is turned on, (by default, it is), disable event validation for the page:
      
    <%@ Page EnableEventValidation="false" %>    

	
aspx Book.xml
Copyright © 2003-2006 ASP.NET Expert Group. All rights reserved.