ComponentOne TreeView for ASP.NET: TreeView for ASP.NET AJAX Task-Based Help > Load and Save C1TreeView through XML > Load an Existing XML TreeView into your Project

Load an Existing XML TreeView into your Project

You can load an existing XML TreeView into your project in the designer or in code. Note that you'll first need to save your treeview as an XML file, see Save the Tree as an XML for details.

Using the Designer

To load the C1TreeView control you saved as an .xml file into your project:

1.   Add the C1TreeView control to your page.

2.   Open the C1TreeView Designer Form.

3.   Click on the File | Load From XML and click open to open the existing .xml file.

 

Using Code

To load the C1TreeView control you saved as an .xml file into your project:

1.   Add C1TreeView to the page.

2.   Create an XML file for the C1TreeView structure.

3.   Call the LoadLayout method to load the items, passing in the path to the file:

      Visual Basic

C1TreeView1.LoadLayout("c:\\Visual Studio 2005\\WebSites\\LoadLayoutEX\\App_Data\\C1TreeViewControl.xml")

      C#

C1TreeView1.LoadLayout("c:\\Visual Studio 2005\\WebSites\\LoadLayoutEX\\App_Data\\C1TreeViewControl.xml");


Send comments about this topic to ComponentOne.
Copyright © 1987-2010 ComponentOne LLC. All rights reserved.