Hi!
This is the test xml that i am using:
<categories>
<category id="1" name="Test1">
<category id="2" name="Test2">
<misc id="1"></misc>
</category>
</category>
<category id="3" name="Test3">
<misc id="2"></misc>
</category>
Now i want to bind that to an ASPX treeview, i want only the elements that have the name category and i want the name of those to appear in the treeview.
Its easy to get the id and names:
var d = from t in data.Descendants("category")
select new { ID = t.Attribute("id").Value, Name = t.Attribute("name").Value };
but how do i keep the structure in the treeview?
This should look like this:
Test1
-> Test2
Test3