What would be the best way to turn a TreeView control's data into an XML document?
I made an XML editor and am having trouble with the save function D:
You could iterate over all of the items in the TreeView, then Iterate over their children etc. Adding them to a file as you go along, that would be the simplest way of doing it.
You could use [url=http://www.facepunch.com/showpost.php?p=21770608&postcount=3]recursion[/url], or possibly .NET's built in XML serializer.
[QUOTE=danharibo;21762098]You could iterate over all of the items in the TreeView, then Iterate over their children etc. Adding them to a file as you go along, that would be the simplest way of doing it.[/QUOTE]
Yeah, thanks. A foreach spam worked fine for me (:
Check this link [URL="http://csharp.net-informations.com/xml/treeview-from-xml.htm"]Treeview from XML [/URL] c# xml tutorial
evan
[highlight](User was permabanned for this post ("bot" - postal))[/highlight]
Sorry, you need to Log In to post a reply to this thread.