I have successfully serialized a treeview to an xml file like so:
Dim formatter = New SoapFormatter()
Dim stream = New FileStream("mytree.xml", FileMode.Create, FileAccess.Write, FileShare.None)
Dim root As New TreeNode()
Dim node As TreeNode
For Each node In TreeView1.Nodes
Catch ec As Exception
MsgBox("Exception at " + ec.TargetSite.Name + ": " + ec.Message)
... I can not however figure out how to deserialize the xml file and re-populate my treeview. I have looked at this url: http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q308063
But haven't found any workable solution. Hasn't someone else ran into this before? Any help would be greatly appreciated.
ADAdministrator Syncfusion Team April 19, 2004 02:28 PM
I am having same issue. Anyone have a solution?
ADAdministrator Syncfusion Team April 21, 2004 10:02 AM
We do have the AppStateSerializer''s SerializeObject/DeserializeObject methods to save/load any control state information on a form. Please refer to the sample in the directory ....\Syncfusion\Essential Suite\126.96.36.199\Shared\Samples\AppStateSerializerDemo which shows how to do this on a TextBox. This can be adapted for the TreeViewAdv as well. Let me know what information regarding the TreeViewAdv do you wish to persist here ? Is it just the collapsed/expanded state information or is there anything else that you wish to persist ? We appreciate your cooperation, and thanks for choosing Syncfusion products.
KHKaren HandelmannFebruary 2, 2005 04:27 AM
I tried to serialize the nodes of a TreeViewAdv.root object and it does not work. Do I have to scan the whole node-hierachie and serialize each TreeNodeAdv itself?