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

What is the corresponding property of "Value" of Web TreeView in WinForm TreeView

2 Answers 42 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Ricky
Top achievements
Rank 1
Ricky asked on 06 Aug 2008, 02:36 AM
Hello,

The TreeNode of TreeView in web version has a "Value" property that can be bound from XML files. Our colleagues cannot find the corresponding one in WinForm TreeView.

Do you suggest any property as a substitute (that can be bound from XML files)?

Thanks a lot.
Ricky.

2 Answers, 1 is accepted

Sort by
0
Jordan
Telerik team
answered on 08 Aug 2008, 09:16 AM
Hi Ricky,

The Tag property of nodes can be used to serialize additional information in XML.
For example the code bellow:
this.radTreeView1.Nodes[0].Tag = 1; 
            this.radTreeView1.Nodes[0].Nodes[0].Tag = "String in tag"
 
            SaveFileDialog saveFileDialog = new SaveFileDialog(); 
            saveFileDialog.AddExtension = true
            saveFileDialog.DefaultExt = ".xml"
            saveFileDialog.Filter = "XML files (*.xml)|*.xml|All files (*.*)|*.*"
 
            if (saveFileDialog.ShowDialog() == DialogResult.OK) 
            { 
                this.radTreeView1.SaveXML(saveFileDialog.FileName); 
            } 

Produces the following XML:

<Nodes Expanded="true" Text="Node1"
<Nodes Expanded="true" Text="Node7"
  <Nodes Text="Node15" />  
  <Nodes Text="Node16" />  
  <Tag xsi:type="xsd:string">String in tag</Tag>  
  </Nodes> 
<Nodes Expanded="true" Text="Node8"
  <Nodes Text="Node14" />  
  </Nodes> 
  <Nodes Text="Node9" />  
  <Tag xsi:type="xsd:int">1</Tag>  
  </Nodes> 
 

Hope that helps.

Regards,
Jordan
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Stefan
Telerik team
answered on 21 Mar 2011, 10:42 AM
Hello Ricky,

Please note that in Q1 2011 we have introduced a major upgrade of RadTreeView control, which is now virtualized and fully customizable. Feel free to download the latest release and try it out. For more information on our latest release refer to this blog post.

Greetings,
Stefan
the Telerik team
Tags
Treeview
Asked by
Ricky
Top achievements
Rank 1
Answers by
Jordan
Telerik team
Stefan
Telerik team
Share this question
or