XML databinding to TreeView (or Tab control), bind attribute based on different attribute

Posted by Number8 on Stack Overflow See other posts from Stack Overflow or by Number8
Published on 2009-08-15T12:08:50Z Indexed on 2010/04/17 7:03 UTC
Read the original article Hit count: 354

Filed under:
|
|

Hello,
I have some xml:

<Test>
  <thing location="home" status="good"/>
  <thing location=work" status="bad"/>
  <thing location="mountains" status="good"/>
</Test>

The leaves on the TreeView are the values of the status attribute; the nodes will be the value of the location attribute.

+--bad
¦.....+--work
+--good
.......+--home
.......+--mountains

Currently, I populate the TreeView (or Tab control) manually, iterating through the xml, adding the nodes to the appropriate leaf.
Can this be done via databinding? I'm guessing a Converter will be involved...
Thanks for any advice.

© Stack Overflow or respective owner

Related posts about Xml

Related posts about databinding