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

Expanding a particular level of Radtreeview

3 Answers 377 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
karthi
Top achievements
Rank 1
karthi asked on 09 Apr 2008, 01:35 PM
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

3 Answers, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 10 Apr 2008, 08:27 AM
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
0
Vivek
Top achievements
Rank 2
answered on 19 Sep 2013, 11:07 AM
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.
0
George
Telerik team
answered on 24 Sep 2013, 08:36 AM
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 >>
Tags
Treeview
Asked by
karthi
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Vivek
Top achievements
Rank 2
George
Telerik team
Share this question
or