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

3 posts, 0 answers
  1. Ricky
    Ricky avatar
    247 posts
    Member since:
    Jun 2007

    Posted 05 Aug 2008 Link to this post

    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. Jordan
    Admin
    Jordan avatar
    547 posts

    Posted 08 Aug 2008 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 21 Mar 2011 Link to this post

    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
Back to Top