or


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title></head><body> <form id="form1" runat="server"> <telerik:RadScriptManager runat="server" ID="RadScriptManager1" /> <telerik:RadButton ID="btnExpand" runat="server" Text="Expand All" OnClick="btnExpand_Click"> </telerik:RadButton> <telerik:RadButton ID="btnCollapse" runat="server" Text="Collapse All" OnClick="btnCollapse_Click"> </telerik:RadButton> <br/> <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel"> <telerik:RadOrgChart ID="RadOrgChart1" runat="server" EnableCollapsing="true" Skin="Office2010Blue" /> </telerik:RadAjaxPanel> </form></body></html>protected void Page_Load(object sender, EventArgs e){ var employees = CreateEmployees(); RadOrgChart1.DataFieldID = "EmployeeID"; RadOrgChart1.DataFieldParentID = "ParentID"; RadOrgChart1.DataTextField = "Name"; //RadOrgChart1.DataImageUrlField = "ImageUrl"; RadOrgChart1.DataSource = employees; RadOrgChart1.DataBind();}private DataTable CreateEmployees(){ var employees = new DataTable(); employees.Columns.Add("EmployeeID"); employees.Columns.Add("ParentID"); employees.Columns.Add("Name"); employees.Columns.Add("ImageUrl"); employees.Rows.Add(new string[] { "1", null, "Kate", "~/Img/Northwind/Customers/LONEP.jpg" }); employees.Rows.Add(new string[] { "2", "1", "Peter", "~/Img/Northwind/Customers/SAVEA.jpg" }); employees.Rows.Add(new string[] { "21", "1", "Peter1", "~/Img/Northwind/Customers/SAVEA.jpg" }); employees.Rows.Add(new string[] { "22", "1", "Peter2", "~/Img/Northwind/Customers/SAVEA.jpg" }); employees.Rows.Add(new string[] { "23", "1", "Peter3", "~/Img/Northwind/Customers/SAVEA.jpg" }); employees.Rows.Add(new string[] { "24", "1", "Peter4", "~/Img/Northwind/Customers/SAVEA.jpg" }); employees.Rows.Add(new string[] { "25", "1", "Peter5", "~/Img/Northwind/Customers/SAVEA.jpg" }); employees.Rows.Add(new string[] { "26", "1", "Peter6", "~/Img/Northwind/Customers/SAVEA.jpg" }); employees.Rows.Add(new string[] { "27", "1", "Peter7", "~/Img/Northwind/Customers/SAVEA.jpg" }); employees.Rows.Add(new string[] { "3", "2", "Arnold", "~/Img/Northwind/Customers/LACOR.jpg" }); employees.Rows.Add(new string[] { "31", "21", "Arnold31", "~/Img/Northwind/Customers/LACOR.jpg" }); employees.Rows.Add(new string[] { "32", "21", "Arnold32", "~/Img/Northwind/Customers/LACOR.jpg" }); employees.Rows.Add(new string[] { "41", "22", "Arnold41", "~/Img/Northwind/Customers/LACOR.jpg" }); employees.Rows.Add(new string[] { "42", "22", "Arnold42", "~/Img/Northwind/Customers/LACOR.jpg" }); employees.Rows.Add(new string[] { "51", "23", "Arnold51", "~/Img/Northwind/Customers/LACOR.jpg" }); employees.Rows.Add(new string[] { "52", "23", "Arnold52", "~/Img/Northwind/Customers/LACOR.jpg" }); employees.Rows.Add(new string[] { "4", "3", "Tim", "~/Img/Northwind/Customers/GREAL.jpg" }); employees.Rows.Add(new string[] { "5", "3", "Nora", "~/Img/Northwind/Customers/TRADH.jpg" }); employees.Rows.Add(new string[] { "6", "4", "David", "~/Img/Northwind/Customers/CENTC.jpg" }); employees.Rows.Add(new string[] { "7", "2", "Mike", "~/Img/Northwind/Customers/VAFFE.jpg" }); return employees;}protected void btnCollapse_Click(object sender, EventArgs e){ RadOrgChart1.CollapseAllNodes();}protected void btnExpand_Click(object sender, EventArgs e){ RadOrgChart1.ExpandAllNodes();}<telerik:GridTemplateColumn HeaderText="Template" SortExpression="Name" ShowSortIcon="true" Groupable="true" DataField="Name" UniqueName="Name">