Click here to Skip to main content
12,076,216 members (36,478 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# ASP.NET
hi,
I create tree view in my design page. Like following
.xml file
<?xml version="1.0" encoding="utf-8" ?>
<Toolbox>
  <item name="Hosting Services">
    <option control="Customers"></option>
    <option control="Employees"></option>
    <option control="Domains"></option>
   
  </item>
</Toolbox>
.aspx
<asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/App_Data/treeview.xml"></asp:XmlDataSource>
    <asp:TreeView ID="TreeView1" runat="server" DataSourceID="XmlDataSource1">
    <DataBindings>
<asp:TreeNodeBinding DataMember="Toolbox" Text="Asp.Net ToolBox"/>
    <asp:TreeNodeBinding  DataMember="item" TextField="name"/>
    <asp:TreeNodeBinding  DataMember="option" TextField="control"/>
    </DataBindings>
    </asp:TreeView>


then the output like this
- Asp.Net ToolBox
- Hosting Services
Customers
Employees
Domains
NOW I WANT TO REMOVE THAT ASP.net Toolbox(root node must be Hosting Service)
PLS HELP ME
THNKS IN ADVNC
Posted 27-Mar-13 23:43pm
Edited 27-Mar-13 23:59pm
v2

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

<asp:TreeView ID="TreeView1" runat="server">
         <Nodes>
             <asp:TreeNode Text="Hosting Service" Value="Hosting Service">
                 <asp:TreeNode ImageUrl="~/images/customer1.png" Text="Customers"
                     Value="Customers"></asp:TreeNode>
                 <asp:TreeNode Text="Employees" Value="Employees"></asp:TreeNode>
                 <asp:TreeNode Text="Domain" Value="Domain"></asp:TreeNode>
                 <asp:TreeNode Text="Subscription" Value="Subscription"></asp:TreeNode>
                 <asp:TreeNode Text="Service Plan" Value="Service Plan"></asp:TreeNode>
             </asp:TreeNode>
         </Nodes>
     </asp:TreeView>
this is correct answer
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160208.1 | Last Updated 28 Mar 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100