XML Treeview
-
I know this one is going to be a hard one. I need to populate a treeview with an XML file. I also need to save the contents of that same treeview to an XML file. The contents inside of the treeview will be user driven. Therefore, the number of entries within the XML file will never be absolute. I need some kinda of dynamic loader and exporter. Any ideas? I have searched all over the web, but I have yet to find what I am looking for. Thanks in advance. P
-
I know this one is going to be a hard one. I need to populate a treeview with an XML file. I also need to save the contents of that same treeview to an XML file. The contents inside of the treeview will be user driven. Therefore, the number of entries within the XML file will never be absolute. I need some kinda of dynamic loader and exporter. Any ideas? I have searched all over the web, but I have yet to find what I am looking for. Thanks in advance. P
It is unclear if you are talking about a specific XML format, or XML files in general. Anyway, this should work: Load the XML file into an XmlDocument and walk though it adding tree nodes as you encounter elements. You can also use an XML loader, which might be better for large files. Is it a specific XML format you might be better of with a data mapper able to serialize and deserialize the XML into an object model. Be careful when populating a tree with many nodes - it can be a performance problem - it might be better to add the child nodes "on demand" as the tree is expanded. For writing, walk though your tree and write to an XML Writer (or build a new XmlDocument, then save that)
-
I know this one is going to be a hard one. I need to populate a treeview with an XML file. I also need to save the contents of that same treeview to an XML file. The contents inside of the treeview will be user driven. Therefore, the number of entries within the XML file will never be absolute. I need some kinda of dynamic loader and exporter. Any ideas? I have searched all over the web, but I have yet to find what I am looking for. Thanks in advance. P
This article(http://www.codeproject.com/csharp/treecollection.asp[^]) can help you manipulate your treeview.I used the tree collection described in above article to add ,save and load tree nodes ... Very useful. DevIntelligence.com - My blog for .Net Developers