473,406 Members | 2,954 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,406 software developers and data experts.

Populate a treeview with a xml file

Hi,
Im trying to populate my treeview control onmy webpage with the information
that is stored in a xml file, but i cant seem to find any good references
about it. The xml file looks like this.

<root>
<page id="1" name="test1" src="test.htm" />
<page id="2" name="test2" src="test2.htm">
<page id="4" name="test2.1" src="test3.htm">
<page id="9" name="test2.1.1" src="test5.htm" />
</page>
<page id="13" name="test2.2" src="test.htm" />
<page id="11" name="test2.3" src="test.htm">
<page id="51" name="test2.4.1" src="test.htm">
<page id="31" name="test2.4.1.1" src="test.htm">
<page id="661" name="test2.4.1.1.1" src="test.htm" />
</page>
<page id="71" name="test2.4.1.2" src="test.htm" />
<page id="991" name="test2.4.1.3" src="test.htm" />
</page>
</page>
<page id="3" name="test2.5" src="test.htm" />
</page>
<page id="1" name="test3" src="test.htm" />
</root>

The pages can just continue on and on. The result i want in my treeview
control is:

root
-test2
-test2.1
-test2.1.1
-test2.2
-test2.3
-test2.4.1
-test2.4.1.1
-test2.4.1.1.1
-test2.4.1.2
-test2.4.1.3
-test2.5
-test3

Also i am looking to insert a New page... after every node that is closing
like this:

root
-test2
-test2.1
-test2.1.1
New page...
-test2.2
-test2.3
-test2.4.1
-test2.4.1.1
-test2.4.1.1.1
New page...
-test2.4.1.2
-test2.4.1.3
New page...
-test2.5
New page...
-test3
New page...

So when the user press the new page it must send the position in the xml
file that the new page is to be added to, so the program can insert a new
page at that position and save the xml file.

Any good code examples of how to populate a treeview using a xml file?

-Patrick
Jun 15 '06 #1
0 1556

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: T.H.M | last post by:
This is the all code. Very simple and short. I need to populate a treeView in aspx page (web form) from XML file. I get en completion error:No overload for method 'TreeNode' takes '1' arguments ....
4
by: Mike | last post by:
how can i populate a treeview from a database? websites with examples would help.
9
by: Marina | last post by:
Hello! I have a database with some customers. Each one of them has 3 other customers under him etc. (something like an MLM system). Now, I want to create a treeview with this. Eg. C1 C11...
2
by: Jack | last post by:
Hello, I am trying to populate a Treeview from a XML File. XML File: <Papers> <Paper> <PaperName>New York Times</PaperName>
2
by: Dave Wurtz | last post by:
All, I have a treeview on my form that has a lot of nodes on it. I would like to populate this treeview on another thread so my form will still paint while it is being populated. I have...
1
by: john wright | last post by:
I have my code done to populate a treeview, but when I move it to the backgroundworker I get an error "Action being performed on this control is being called from the wrong thread. Marshal to the...
6
by: Beginner | last post by:
Hi, I'm trying to populate a TreeView from an existing and filled in ListView (lvwBuild). lvwBuild is a basic two column listview which can have any number of rows. I would like the first...
2
by: thanneman | last post by:
Hello all, First off all, I appollogize for my englisch. I have a problem. I have a table in my sql database with 2 fields. Field 1 is an ID, and Field 2 contains the complete file locations. ...
0
by: xmail123 | last post by:
How to populate a treeview from a dataset I am very new to C#. I need to create a Windows form that will read a SQL table and populate a treeview. I can connect to the DB, create the...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.