Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
I create tree view in my design page. Like following
.xml file
XML
<?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
XML
<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
Updated 27-Mar-13 22:59pm
v2

1 solution

XML
<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
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900