TreeView not Serializes ForeColor and Tag

2 posts, 1 answers
  1. Sergey
    Sergey avatar
    1 posts
    Member since:
    Feb 2008

    Posted 20 Mar 2008 Link to this post

    I have a problem. This is my code:

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

    this result XML:


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

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

  2. Answer
    Jordan avatar
    547 posts

    Posted 21 Mar 2008 Link to this post

    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="" xmlns:xsd="" 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 Expanded="true" Text="Node8"
      <Nodes Text="Node14" />  
      <Nodes Text="Node9" />  
    <Nodes Expanded="true" Text="Node2"
      <Nodes Text="Node10" />  
      <Nodes Text="Node11" />  
      <Nodes Text="Node3" />  
    <Nodes Expanded="true" Text="Node4"
      <Nodes Text="Node12" />  
      <Nodes Text="Node13" />  
      <Nodes Text="Node5" />  
      <Nodes Text="Node6" />  

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

    All the best,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top