472,993 Members | 2,575 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

XML to treeview

Hi there

I have an XML file that looks like this:

<?xml version="1.0" encoding="utf-8"?>
<Node xmlns="Level 1">
<Node xmlns="Level 2A">
</Node>
<Node xmlns="Level 2B">
<Node xmlns="Level 3A">
</Node>
</Node>
</Node>

I want to load this XML file into a TreeView component so it looks something
like this:

- Level 1
- Level 2A
- Level 2B
- Level 3A

I have tried alot of solutions on the internet, but most of them add extra
nodes to the treeview for each XMLNode they find. In the above example I
just want to add the 4 nodes into the treeview, not more.

Regards

/PZ

Feb 21 '06 #1
3 4679

Preben Zacho wrote:
I want to load this XML file into a TreeView component


Which TreeView do you want to use, the one for Windows applications in
System.Windows.Forms or the one for ASP.NET 2.0 applications in
System.Web.UI.WebControls?

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Feb 21 '06 #2


Preben Zacho wrote:
I want to load this XML file into a TreeView component so it looks something
like this:

- Level 1
- Level 2A
- Level 2B
- Level 3A


With ASP.NET 2.0 and its TreeView here is how it is possible

<asp:XmlDataSource
ID="XmlDataSource1"
runat="server"
DataFile="file.xml" ></asp:XmlDataSource>

<asp:TreeView
id="TreeView1"
runat="server"
DataSourceID="XmlDataSource1">
<DataBindings>
<asp:TreeNodeBinding DataMember="Node" TextField="xmlns" />
</DataBindings>
</asp:TreeView>
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Feb 21 '06 #3
Hi Martin

I want to use the one for Windows (System.Windows.Forms).

Regards

PZ

"Martin Honnen" <ma*******@yahoo.de> wrote in message
news:Oq**************@TK2MSFTNGP12.phx.gbl...

Preben Zacho wrote:
I want to load this XML file into a TreeView component


Which TreeView do you want to use, the one for Windows applications in
System.Windows.Forms or the one for ASP.NET 2.0 applications in
System.Web.UI.WebControls?

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

Feb 22 '06 #4

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

Similar topics

42
by: lauren quantrell | last post by:
So many postings on not to use the treeview control, but nothing recently. Is it safe to swim there yet with Access 2000-Access 2003?
5
by: SoKool | last post by:
Can anyone point me to a site where I can get a free treeview control to use in ASP .NET or any tutorial that can help me build my own treeview control. I intend to use a treeview to generate a...
1
by: paradox | last post by:
I want to have a TreeView that shows an image on some items, but not all. Basically, if a certain condition is true, a caution icon is placed next to the treeview item. The problem is that, by...
3
by: Peter | last post by:
Hello, We are inserting a side menu to our application using a class that is writing HTML on all our pages. This is a part of the code as an example: writer.Write(" <table WIDTH=""100%""...
6
by: L.M | last post by:
Hello, I knew how to use the treeview under VB6. After migrating to .NET, well, I'm lost. I try to add a new node, either to the same level or as a child to a selected node in the treeview....
14
by: Mr.D | last post by:
How do I save/load the contents of a Treeview to a file? I have found several good examples written i VB6, but not a single one for VB.NET. Please help. ---- Tim
3
by: christof | last post by:
I've got a really easy problem, please help me: There are two pages in one I'm creating a TreeView like that: TreeView dbTree = new TreeView(); TreeNode dbTreeRoot = new TreeNode("Root");...
2
by: Tymbow | last post by:
I'm building a web application that is analogous to the Windows XP file explorer in function. The left column contains a TreeView, and the right column a DataGrid populated by selecting TreeView...
1
by: kvicky | last post by:
I am trying to load child nodes to a TreeNode in a TreeView in a ASP.net web application. The Treeview with parent nodes are loaded on a Page_load while doing if( ! ISPostback ) and then in the...
8
by: Matt MacDonald | last post by:
Hi All, I have a form that displays hierarchical categories in a treeview. Ok so far so good. What I was to do is have users be able to select a node in the treeview as part of filling out the...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.