Warning on Node.Parent and .Index

7 posts, 0 answers
  1. Gourangi
    Gourangi avatar
    83 posts
    Member since:
    Mar 2008

    Posted 01 Jul 2008 Link to this post

    Hi,

    i am getting warning while accessing RadTreeNode's Parent and Index property that it is obsolete.

    Can i have some replacement for this so those warning be removed ?

    Thanks
  2. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 03 Jul 2008 Link to this post

    Hello Divyesh,

    These properties are marked as obsolete because the setters of the Parent and Index properties will be removed. However, the getters will not be removed and you still will be able to get the needed value.

    In case you are using the setters of these properties, here is how you should modify your code:
    1. Instead of radTreeNode2.Parent = radTreeNode1, you should add radTreeNode2 in the Nodes collection of radTreeNode1 using the Add method. Supposing that radTreeNode1 is the first node in the RadTreeNode.Nodes collection (i.e. with Index 0), the code is:
      this.radTreeView1.Nodes[0].Nodes.Add(radTreeNode2); 
    2. Instead of using radTreeNode2.Index = 1, you should insert the node in the Nodes collection (using the Insert method) and give the appropriate index:
      this.radTreeView1.Nodes.Insert(1, radTreeNode2); 
    If you have additional questions, do not hesitate to contact me.

    Best wishes,
    Nikolay
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Gourangi
    Gourangi avatar
    83 posts
    Member since:
    Mar 2008

    Posted 03 Jul 2008 Link to this post

    hi,

    i dont want to add/insert any node. i just want an index of particular node !

    With Regards,

    Divyesh
  5. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 04 Jul 2008 Link to this post

    Hello Divyesh,

    The warning for the Index property will be removed once the setter of this property is removed. This will be addressed in one of our next versions.

    If you have additional questions, feel free to contact me.

    Sincerely yours,
    Nikolay
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. Gourangi
    Gourangi avatar
    83 posts
    Member since:
    Mar 2008

    Posted 04 Jul 2008 Link to this post

    Thank you Nikolay
  7. William
    William avatar
    55 posts
    Member since:
    Sep 2008

    Posted 16 Oct 2008 Link to this post

    So just to be clear in the future this will work?

     

    Dim node As RadTreeNode

     

    node =

    New RadTreeNode("Profile")

     

    tvTreeView.Nodes.Add(node)

     

    node = New RadTreeNode("Publications")

     

    tvTreeView.Nodes.Add(node)

     

    node = New RadTreeNode("New Publication")

     

    tvTreeView.Nodes(

    "Publications").Nodes.Add(node)

     

    tvTreeView.ExpandAll()

  8. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 20 Oct 2008 Link to this post

    Hello William,

    Correct. This code snippet will work in our future versions and you should have no worries about it. If you have additional questions, feel free to contact me further.

    Best wishes,
    Nikolay
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top
UI for WinForms is Visual Studio 2017 Ready