Export Treeview to Array, Save to XML

J

Jim P.

I'm building a Task program. I've got the XMLTextReader working: opening &
parsing the XML files, and propagating the TreeView with nodes & childs.
But I don't know how to export out the contents of the TreeView into an
Array. I then want to take the array and use XMLTextWriter to build an XML
file that will be saved to the local disk.

thanks.
 
B

Bharat Patel [MSFT]

Jim,

You can directly use SoapFormatter as mentioned in the following post:

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=YETZOKzzBHA.227
6%40cpmsftngxa09

Or you can loop through the root node recursively until you find the children
and serialize it manually.
There is no direct sample available; however, the VB .net code in the following
article will give you some idea although it is exactly opposite of what you
want to do. You will need to work it backward fashion.

308063 HOW TO: Populate a TreeView Control with XML Data in Visual Basic .NET
http://support.microsoft.com/?id=308063

Hope this helps!
Bharat Patel
Microsoft, Visual Basic .NET

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only. Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top