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

TreeView not Serializes ForeColor and Tag

1 Answer 48 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Sergey
Top achievements
Rank 1
Sergey asked on 20 Mar 2008, 09:49 AM
I have a problem. This is my code:

RadTreeNode node = new RadTreeNode("new");  
node.ForeColor2 = Color.Blue;
node.Tag = "new text"; 
radTV.SelectedNode.Nodes.Add(node);  
radTV.SaveXML(@"treeview.xml"); 

this result XML:

<

Nodes Text="new">
<
ForeColor />
<
ForeColor2 />
<
BackColor />
<
BackColor2 />
<
BackColor3 />
<
BackColor4 />
<
BorderColor />
</
Nodes>

Why I Can't save ForeColor in XML?
use Q2 2007

1 Answer, 1 is accepted

Sort by
0
Accepted
Jordan
Telerik team
answered on 21 Mar 2008, 12:49 PM
Hello Sergey,

This issue has been fixed in the latest stable version of RadControls for WinForms, i.e. Q3 2007 SP1.
Now not only are the ForeColor values serialized but the XML output is better.

Here is an example:
<?xml version="1.0" encoding="utf-8" ?>  
<TreeView xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" AllowDragDrop="true" LabelEdit="true" AllowDrop="true" BackColor="Transparent"
<Nodes Expanded="true" Text="Node1" BackColor="Red"
<Nodes Expanded="true" Text="Node7" BackColor="Yellow"
  <Nodes Text="Node15" ForeColor="Green" />  
  <Nodes Text="Node16" />  
  </Nodes> 
<Nodes Expanded="true" Text="Node8"
  <Nodes Text="Node14" />  
  </Nodes> 
  <Nodes Text="Node9" />  
  </Nodes> 
<Nodes Expanded="true" Text="Node2"
  <Nodes Text="Node10" />  
  <Nodes Text="Node11" />  
  </Nodes> 
  <Nodes Text="Node3" />  
<Nodes Expanded="true" Text="Node4"
  <Nodes Text="Node12" />  
  <Nodes Text="Node13" />  
  </Nodes> 
  <Nodes Text="Node5" />  
  <Nodes Text="Node6" />  
  </TreeView> 

In order to have that improved XML serialization, you need to install the 2007 Q3 SP1 version of RadControls for WinForms.

All the best,
Jordan
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Treeview
Asked by
Sergey
Top achievements
Rank 1
Answers by
Jordan
Telerik team
Share this question
or