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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Serialize/Deserialize TreeView

Thread ID:





3176 Mar 6,2003 06:45 PM UTC Feb 2,2005 09:27 AM UTC General Discussion 3
Tags: General Discussion
Patrick Ransom
Asked On March 6, 2003 06:45 PM UTC

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 06:28 PM UTC

I am having same issue. Anyone have a solution?

Administrator [Syncfusion]
Replied On April 21, 2004 02:02 PM UTC

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\\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 09:27 AM UTC

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?


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon