using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;

public partial class TreeView_Temp_TreerControl : System.Web.UI.UserControl
{
    Telerik.Web.UI.RadTreeView radTree = new Telerik.Web.UI.RadTreeView();
	protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            
     
         Telerik.Web.UI.RadPageView tmpPageView = new Telerik.Web.UI.RadPageView();
        tmpPageView.ID = "AAA";
        radMPCapabilities.PageViews.Add(tmpPageView);

        //Add a Tab for the AbilityType
        Telerik.Web.UI.RadTab tmpTab = new Telerik.Web.UI.RadTab("AAA", "1");
        tmpTab.PageViewID = tmpPageView.ID;
        radTSCapabilities.Tabs.Add(tmpTab);

        //Create and Load the Rad Tree
       
        radTree.Skin = "Default";
        radTree.CheckBoxes = true;
        radTree.TriStateCheckBoxes = true;
        radTree.CheckChildNodes = true;
      //  radTree.NodeDataBound += new RadTreeViewEventHandler(radTree_NodeDataBound);
        radTree.ID = "1" + "AAA".Replace(" ", "_");
        radTree.DataTextField = "LastName";
        radTree.DataValueField = "PhotoPath";
        radTree.DataFieldID = "EmployeeID";
        radTree.DataFieldParentID = "ReportsTo";
        radTree.DataSourceID = "SqlDataSource1";
      

        //Add a top border
        Literal tmpLiteral = new Literal();
        tmpLiteral.Text = "<div style='border-top:solid 1px #AAAAAA;'></div>";

        //Add the Literal and Tree to the associated PageView
        radMPCapabilities.FindControl("AAA").Controls.Add(tmpLiteral);
        radMPCapabilities.FindControl("AAA").Controls.Add(radTree);
       
        }
        radTree.DataBind();
    }

    void radTree_NodeDataBound(object sender, RadTreeNodeEventArgs e)
    {
        throw new NotImplementedException();
    }





   
}