Expanding a particular level of Radtreeview

4 posts, 0 answers
  1. karthi
    karthi avatar
    1 posts
    Member since:
    Mar 2008

    Posted 09 Apr 2008 Link to this post

    Hi,

    On add of a child node to a level , I want to know how to expand that particular level(to which the new node is added) and highlight the newly added node

    Thanks in advance
    Karthi
  2. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 10 Apr 2008 Link to this post

    Hello karthi,

    Thank you for writing.

    The easiest way to expand and highlight an inserted node is to set its Selected property to true. Please review the provided code-block below as a reference:

    private void radButton1_Click(object sender, EventArgs e)  
    {  
        RadTreeNode newNode = new RadTreeNode();  
        newNode.Text = "MyNewNode";  
     
        AddNewNode(this.radTreeView1.Nodes[1].Nodes[2], 1, newNode);  
    }  
     
    private void AddNewNode(RadTreeNode parentNode, int insertPosition, RadTreeNode nodeToInsert)  
    {  
        parentNode.Nodes.Insert(insertPosition, nodeToInsert);  
        nodeToInsert.Selected = true;  

    I hope this was helpful. Do not hesitate to contact me again if you need additional assistance. 

    Best wishes,
    Martin Vasilev
    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. Vivek
    Vivek avatar
    38 posts
    Member since:
    Mar 2013

    Posted 19 Sep 2013 Link to this post

    I also have to collapse root node upto level 1 at client side, please let me know.

    Root Node
           - Contract 1
           - Contract 2

    for more details, pls refer attached snap shot.
  5. George
    Admin
    George avatar
    500 posts

    Posted 24 Sep 2013 Link to this post

    Hello Vivek,

    Thank you for writing.

    Please refer to the attached project where I am recursively traversing all the nodes in the RadTreeView and collapsing/expanding them according to their check state.

    I hope this will help.
     
    Regards,
    George
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top