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

Programmatically select treeviewitem

1 Answer 147 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
William
Top achievements
Rank 1
William asked on 17 Aug 2009, 10:37 PM
I'm adding items to a treeview programmatically and have set the tag property to a unique value.  How can I loop the items and when I come to my value select the item and then exit the loop.  I'm using


 

For Each item As RadTreeViewItem In RadTreeView1.Items

 

 

If CInt(item.Tag) = 3 Then

 

item.IsSelected =

True

 

 

Exit For

 

 

End If

 

 

Next

However I need to get the child items to the first treeview item

Thanks

 

1 Answer, 1 is accepted

Sort by
0
Valentin.Stoychev
Telerik team
answered on 18 Aug 2009, 05:40 AM
Hello William,

Each RadTreeViewItem has its own Items collection which you can examine the same way as you examine the RadTreeView Items collection.

Kind regards,
Valentin.Stoychev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
TreeView
Asked by
William
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
Share this question
or