Task-Based Help > Populating C1TreeView with XML |
This tutorial teaches you how installed templates, add the XML Data Source component to the Web site, assign it to the C1TreeView control, and then set the binding for the C1TreeView.
Complete the following steps:
Markup |
Copy Code
|
---|---|
<?xml version="1.0" encoding="utf-8" ?> <root> <TreeViewNode Text="CDs">\ <TreeViewNode Text="Back to Black"></TreeViewNode> <TreeViewNode Text="Frank"></TreeViewNode> <TreeViewNode Text="Nevermind"></TreeViewNode> <TreeViewNode Text="In Utero"></TreeViewNode> </TreeViewNode> <TreeViewNode Text="Cassette Tapes"> <TreeViewNode Text="Bleach"></TreeViewNode> <TreeViewNode Text="Cheap Thrills"></TreeViewNode> <TreeViewNode Text="Dangerous"></TreeViewNode> <TreeViewNode Text="Bad"></TreeViewNode> </TreeViewNode> <TreeViewNode Text="Vinyl Records"> <TreeViewNode Text="Axis: Bold as Love"></TreeViewNode> <TreeViewNode Text="Full Circle"></TreeViewNode> <TreeViewNode Text="Off The Wall"></TreeViewNode> <TreeViewNode Text="Other Voices"></TreeViewNode> </TreeViewNode> </root> |
XmlDataSource1 is added to the project.
The Configure Data Source dialog box opens.
The Bindings Collection Editordialog box opens.
Observe that the data from the TreeView_Hierarchy.xml file is reflected in the C1TreeView control.