I have the following XML:
<case name="active_type1_smith_1" office="newcastle" />
<case name="active_type1_jones_1" office="sunderland" />
<case name="active_type2_elliott_1" office="newcastle" />
<case name="active_type2_davies_1" office="london" />
and am using the following to iterate through a list of the cases:
foreach(XElement Case In (XDocument.Load("case.xml").Descendants().Where(node => node.Name == "case")
What I am looking for is a way to populate a C# based treeview object based on the XElements obtained. The office attribute should be the parent nodes within the tree and then a child node based on the name attrbiutes 'type' e.g. type1 and then the full name itself. If a parent of child node already exists the current node should be added to the existing node structure. So the above would look like...
I would like to implement this as part of a C# solution and am a bit of a newbie. Also I would like the ability to control the apperance and event handlers of the individual tree nodes - which I think I can work out myself but would like the solution to give me some access to the tree nodes being added to facilitate this.