We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Serialize/Deserialize TreeView

Thread ID:

Created:

Updated:

Platform:

Replies:

3176 Mar 6,2003 01:45 PM Feb 2,2005 04:27 AM General Discussion 3
loading
Tags: General Discussion
Patrick Ransom
Asked On March 6, 2003 01:45 PM

I have successfully serialized a treeview to an xml file like so: Dim formatter = New SoapFormatter() Try 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 root.Nodes.Add(CType(node.Clone(), TreeNode)) Next node formatter.Serialize(stream, root) stream.Close() Catch ec As Exception MsgBox("Exception at " + ec.TargetSite.Name + ": " + ec.Message) End Try ... 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. Patrick

Administrator [Syncfusion]
Replied On April 19, 2004 02:28 PM

I am having same issue. Anyone have a solution?

Administrator [Syncfusion]
Replied On April 21, 2004 10:02 AM

Hi Patrick, 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\2.0.3.0\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. Regards, Guru Patwal Syncfusion, Inc.

Karen Handelmann
Replied On February 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?

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;