This is a migrated thread and some comments may be shown as answers.

SaveXML and LoadXML only works partially

2 Answers 175 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Alain
Top achievements
Rank 1
Alain asked on 19 Jun 2011, 06:51 AM
Hi,

I'm using Winform Q1 2011 SP1 and VS2008.
While trying RadTreeView.SaveXML(@"TreeView.xml") , I noticed that information such as forecolor, strikeout fontstyle ...for each individual node is not saved in the XML document.
When using RadTreeView.LoadXML(@"TreeView.xml")), and while information such as CheckState="On" is in the XML document next to some nodes, the RadTreeView is loaded without any of the node's checkboxes being 'checked (they're all left unchecked).
Also and if I add manually Forecolor="Green" in the TreeView.xml document next to some nodes, the LoadXML method will assign correctly the color green to some nodes.

As I plan to let the user decide of the data to be added in the RadTreeView, it sounded like a promising feature, so is there anyway to correct the above (get checkboxes checked or unchecked, forecolor...)? 
SaveXML allows for some extra types to be saved. What are they? Any documentation on this?

The help file mentions also that 'For direct access to the tree view XML as text use the TreeViewXML property.'. How is this implemented concretely?

Best regards,
Alain Cavenaile

2 Answers, 1 is accepted

Sort by
0
Svett
Telerik team
answered on 22 Jun 2011, 07:36 PM
Hi Alain,

I confirm that the illustrated case is an issue with RadTreeView. It will be addressed in one of the next major releases. In the meantime, I cannot give you work around due to internal implementation of RadTreeView serialization. I added it to our public issue tracking system. I hope that this is not show stopper for you.

The TreeViewXml property contains the XML data representation of RadTreeView. It invokes internally the SaveXML and LoadXML methods. The extraTypes parameter of these method allows easy XML serialization extending. This gives opportunity to increase the object-graph serialization. You can read more about that in this MSDN article

Thank you for your understanding and cooperation. I updated your Telerik points.

Greetings,
Svett
the Telerik team
Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.
0
Alain
Top achievements
Rank 1
answered on 25 Jun 2011, 08:26 AM
Thanks for your feedback.

I managed to serialize and deserialize the RadTreeView by adapting the code from the following link (I posted it here in case other Telerik users would like a work around on RadTreeView.SaveXML and LoadXML):
http://www.codeproject.com/KB/vb/TreeViewDataAccess.aspx
then included also font, forecolor...

So my issue is basically solved.

Best regards,
Alain

Tags
Treeview
Asked by
Alain
Top achievements
Rank 1
Answers by
Svett
Telerik team
Alain
Top achievements
Rank 1
Share this question
or