Tree View and XML

jagoh87

Member
Joined
Nov 21, 2006
Messages
8
Programming Experience
Beginner
Hi have the following XML

VB.NET:
 [COLOR=#000080]<?xml version=[COLOR=#0000ff]"1.0"[/COLOR] ?>[/COLOR] 
- [COLOR=#000080]<Offices>[/COLOR]
- [COLOR=#000080]<UK>[/COLOR]
  [COLOR=#000080]<Hull />[/COLOR] 
  [COLOR=#000080]<Middlesbrough />[/COLOR] 
  [COLOR=#000080]<Manchester />[/COLOR] 
  [COLOR=#000080]<Belfast />[/COLOR] 
  [COLOR=#000080]<Linertech />[/COLOR] 
  [COLOR=#000080]</UK>[/COLOR]
- [COLOR=#000080]<Europe>[/COLOR]
  [COLOR=#000080]<Rotterdam />[/COLOR] 
  [COLOR=#000080]<LeHavre />[/COLOR] 
  [COLOR=#000080]<Dusseldorf />[/COLOR] 
  [COLOR=#000080]<Uentrop />[/COLOR] 
  [COLOR=#000080]<Schwechat />[/COLOR] 
  [COLOR=#000080]<Porvoo />[/COLOR] 
  [COLOR=#000080]</Europe>[/COLOR]
  [COLOR=#000080]</Offices>[/COLOR]

My program populates a tree view from this XML file. I then want the users to click on a node and for this put data into a text box relevent to that node. Before i used XML to populate the tree view i was adding a tag to each node then using
VB.NET:
[LEFT]TreeView1.SelectedNode.Tag[/LEFT]
to get the data to the textbox.

Can i add tags to the XML file or will i have to do it another way?

Thanks for the help
 
Er... youre reading XML and populating the tree yourself, right? So you would add extra info to the XML file, and assign that info to the tag of the node?
 
Er... youre reading XML and populating the tree yourself, right? So you would add extra info to the XML file, and assign that info to the tag of the node?

Yeah thats right, the tree view is populated from the xml file, and what i want is when i click on a node of the tree view it puts the tag/info of that node into the textbox.

So some how in the xml file add a tag/info to each node.

someone has suggested class node(object) but not sure how to implement it if its correct
 
Last edited:
i think youre making this harder than it is..

if your xml file is like:

<france>
<paris ip="200.100.100.200" />
<marseilles ip="200.100.100.201" />


then you just read the ip out of the xml as youre making the tree. Maybe i misunderstood you, but it seems that if youre capable of reading the xml into the tree already, then this change is very, very trivial
 
Back
Top