using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using System.Xml;
using APNSoft.WebControls;

public partial class TreeView_PopulateDynamically : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //Set empty DataSource from XmlDocument
        myTreeView.DataSource = new XmlDocument();
        myTreeView.DataBind();


        //Get elements collection
        TreeViewElementCollection _Elements = myTreeView.Elements;

        //Add root elements
        _Elements.AddRootItem("Home");
        TreeViewElement _AboutUs = _Elements.AddRootItem("About Us");
        _Elements.AddRootItem("Products");
        _Elements.AddRootItem("Solutions");

        //Add child nodes for "About Us"
        _AboutUs.AddChildItem("Awards");
        _AboutUs.AddChildItem("Certificates");
        TreeViewElement _ContactUs = _AboutUs.AddChildItem("Contact Us");
        _AboutUs.AddChildItem("Financial Highlights");
        _AboutUs.AddChildItem("History");

        //Add child nodes for "Contact Us"
        _ContactUs.AddChildItem("Call Us");
        _ContactUs.AddChildItem("E-mail Us");
    
    }
}