473,385 Members | 1,379 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

tree view control

21
hey there i have made a tree view control and i am having a problem that my data is not displaying on the screen can any body solve my problem


here below is the code

Expand|Select|Wrap|Line Numbers
  1. <asp:XmlDataSource ID="XmlDataSource1" runat="server" 
  2.             DataFile="~/App_Data/treedata.xml" XPath="\treedata" 
  3.             TransformFile="~/App_Data/xslfile.xslt"></asp:XmlDataSource>
  4.  
  5. <asp:TreeView ID="PageTreeView" runat="server" DataSourceID="XmlDataSource1" 
  6.             ExpandDepth="5" onselectednodechanged="TreeView1_SelectedNodeChanged" 
  7.             ShowLines="True">
  8.  
  9.     <DataBindings>
  10.  
  11.         <asp:TreeNodeBinding DataMember="genre" TextField="name" />
  12.  
  13.         <asp:TreeNodeBinding DataMember="book" TextField="title" />
  14.  
  15.         <asp:TreeNodeBinding DataMember="title" FormatString="ISBN: {0}" TextField="ISBN" />
  16.  
  17.         <asp:TreeNodeBinding DataMember="price" FormatString="${0}" TextField="#InnerText" />
  18.  
  19.         <asp:TreeNodeBinding DataMember="comments" Text="Comments" Value="Comments" />
  20.  
  21.         <asp:TreeNodeBinding DataMember="userComment" TextField="#InnerText" ToolTipField="rating" />
  22.  
  23.     </DataBindings>
  24.  
  25. </asp:TreeView>  

now below is the xml file names "treedata.xml"
Expand|Select|Wrap|Line Numbers
  1. <bookstore>
  2.  
  3.     <genre name="fiction">
  4.  
  5.         <book ISBN="10-000000-001" title="The Iliad and The Odyssey">
  6.  
  7.             <title ISBN="10-000000-001">The Iliad and The Odyssey</title>
  8.  
  9.             <price>12.95</price>
  10.  
  11.             <comments>
  12.  
  13.                 <userComment rating="4">Best translation I've read.</userComment>
  14.  
  15.                 <userComment rating="2">I like other versions better.</userComment>
  16.  
  17.             </comments>
  18.  
  19.         </book>
  20.  
  21.         <book ISBN="10-000000-999" title="Anthology of World Literature">
  22.  
  23.             <title ISBN="10-000000-999">Anthology of World Literature</title>
  24.  
  25.             <price>24.95</price>
  26.  
  27.             <comments>
  28.  
  29.                 <userComment rating="3">Needs more modern literature.</userComment>
  30.  
  31.                 <userComment rating="4">Excellent overview of world literature.</userComment>
  32.  
  33.             </comments>
  34.  
  35.         </book>
  36.  
  37.     </genre>
  38.  
  39.     <genre name="nonfiction">
  40.  
  41.         <book ISBN="11-000000-002" title="Computer Dictionary">
  42.  
  43.             <title ISBN="11-000000-002">Computer Dictionary</title>
  44.  
  45.             <price>24.95</price>
  46.  
  47.             <comments>
  48.  
  49.                 <userComment rating="3">A valuable resource.</userComment>
  50.  
  51.             </comments>
  52.  
  53.         </book>
  54.  
  55.         <book ISBN="11-000000-003" title="Cooking on a Budget">
  56.  
  57.             <title ISBN="11-000000-003">Cooking on a Budget</title>
  58.  
  59.             <price>23.95</price>
  60.  
  61.             <comments>
  62.  
  63.                 <userComment rating="4">Delicious!</userComment>
  64.  
  65.             </comments>
  66.  
  67.         </book>
  68.  
  69.     </genre>
  70.  
  71. </bookstore>
below is the page load function

Expand|Select|Wrap|Line Numbers
  1. protected void Page_Load(object sender, EventArgs e)
  2.     {
  3.         XmlDataSource1.XPath = "treedata.xml";
  4.         PageTreeView.DataBind();
  5.     }
  6.  
thanxxx regards furqi
Feb 16 '10 #1
0 1172

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Nick Warrington | last post by:
Hi all, I am having a small problem with a tree control I am playing with. I have created a custom tree view that displays nodes with a linktext control to the right of the nodes. When the...
1
by: Kaye | last post by:
It seems that when I dynamically resize items in a tree-view control, using TVM_SETITEM and the TVITEMEX iIntegral member, things go awry. The window draws properly, but it seems like the RECTs for...
10
by: dwok | last post by:
Does anyone know of a good article that discusses creating a "Tree View" control in ASP.NET? Or perhaps a Tree View Control that comes with source code? I have come across a lot of tree controls...
3
by: Alan Silver | last post by:
Hello, I am just looking at the tree view control, which looks very good, but has some apparent limitations. This could easily be my lack of experience with it. Specifically, I have two...
7
by: Andrew Robinson | last post by:
I have a treeview control that I use as a menu & navigation control within a master page. The nodes for this control are loaded from a database which contains the text and url of each like and the...
1
by: JN | last post by:
Hi All, I have a tree view which has parent nodes of each letter of the alphabet. The root node will be the customers name that relate to the parent node letter. I also have a gridview which is...
0
by: Santosh | last post by:
Asp.Net tree view control font problem Dear all i am downloading MS tree view control . i want to change the font size and font name of the tree view control i am wrtitting code for it like ...
0
by: rinishrk | last post by:
Hi, I have a web application that contains subfolders Admin and User with related webpages inside them. Within the Admin folder I have a page containing a Tree View Control.I want this tree view...
1
by: perspolis | last post by:
Hi all I'm looking for a Combobox that displays tree. Does anyone has a source code for that??? thanks in advance
1
by: BeginingOfLife | last post by:
i am using a java script to create a tree view in my html page. i got that script from this link : http://destroydrop.com/javascripts/tree/ given script is static script creations for tree...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.