New to Telerik UI for WinForms? Download free 30-day trial

Serialize/Deserialize to XML

RadTreeView methods LoadXML and SaveXML serialize the contents and state of the entire RadTreeView and its nodes. These methods can be useful when you want to save the data locally and without needing to connect to a database for binding.

TreeView xmlns:xsi="" xmlns:xsd="" AllowDragDrop="true" LabelEdit="true" ThemeName="Breeze" AllowDrop="true" BackColor="Transparent"><Nodes Expanded="true" Text="Node1"><Nodes Expanded="true" Text="Node7"><Nodes Text="Node15" /><Nodes Text="Node16" /></Nodes><Nodes Expanded="true" Text="Node8"><Nodes Text="Node14" /></Nodes><Nodes Text="Node9" /></Nodes><Nodes Expanded="true" Text="Node2"><Nodes Text="Node10" /><Nodes Text="Node11" /></Nodes><Nodes Text="Node3" /><Nodes Expanded="true" Text="Node4"><Nodes Text="Node12" /><Nodes Text="Node13" /></Nodes><Nodes Text="Node5" /><Nodes Text="Node6" /></TreeView>

For direct access to the tree view XML as text use the TreeViewXML property.

The contents of the saved XML file contain the properties for the RadTreeView as a whole and each of the nodes in the tree.

treeview-data-binding-serialize-deserialize-to-xml 001

RadTreeView supports save/load functionality at design time via the Property Builder.

See Also

In this article
Not finding the help you need? Improve this article