Click here to Skip to main content
Rate this: bad
good
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
0 OriginalGriff 562
1 Sergey Alexandrovich Kryukov 484
2 Maciej Los 325
3 DamithSL 233
4 Mathew Soji 195
0 OriginalGriff 7,168
1 Sergey Alexandrovich Kryukov 6,377
2 DamithSL 5,461
3 Manas Bhardwaj 4,876
4 Maciej Los 4,450


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 28 Mar 2013
Copyright © CodeProject, 1999-2014
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