dj_user2
asked on
Binding xml data to TreeView control?
Can anyone provide a code sample on how to bind xml data to a TreeView control. (Or any other control, but I want to be able to expand and collapse nodes)
The structure of the xml data is not known/not pre-defined, it varies a lot.
The structure of the xml data is not known/not pre-defined, it varies a lot.
HI dj_user2,
Refer the following link. This contains how to bind xml with treeview, both static and dynamic
http://www.15seconds.com/issue/041117.htm
Refer the following link. This contains how to bind xml with treeview, both static and dynamic
http://www.15seconds.com/issue/041117.htm
Hi,
Just load dataset from XML file and bind with tree view control.
Thanks.
Just load dataset from XML file and bind with tree view control.
Thanks.
ASKER
Like mentioned in the OP, we don't know what nodes, values, and attributes the xml data has. Both links assumes xml data format is known to the user.
Binding the xml data to the treeview is displaying just the node names, not the node values.
Binding the xml data to the treeview is displaying just the node names, not the node values.
this link does have the way of creating dynamic nodes
check it out
http://www.15seconds.com/issue/041117.htm
check it out
http://www.15seconds.com/issue/041117.htm
ASKER
Being able to create notes dynamically is not our requirement. We already have all the data in xml format. I just want to bind it to the tree view control, and be able to expand, collapse, view all the nodes and values.
The article you mentioned creates nodes dynamically from a database table, looping through each row and each field.
The article you mentioned creates nodes dynamically from a database table, looping through each row and each field.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Which version of .NET Framework? The newer versions are a bit more complicated than .NET 1.1
http://www.c-sharpcorner.com/UploadFile/manishkdwivedi/treeviewcontrol01072008003526AM/treeviewcontrol.aspx