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

[Solved] How to get TreeViewItem in status changed event?

1 Answer 154 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Balaram Barange
Top achievements
Rank 1
Balaram Barange asked on 29 Apr 2009, 04:12 PM
Hello,

We are facing with the problem that we cant get the TreeViewItem for which the ItemContainerGenerator_StatusChanged event is fired.

For example: say there is one parent node and some child nodes. Now how we come to know that for which treeitem the event is fired?
We have to perform separate operation depending on the level of item, i.e Parent or child.

Hope, you get the problem.

1 Answer, 1 is accepted

Sort by
0
Miroslav
Telerik team
answered on 30 Apr 2009, 09:48 AM
Hello Balaram,

There are is an event that notifies you when an item is created and a property that shows its depth (level). Here is how you can use them:

treeView.ItemPrepared += new EventHandler<RadTreeViewItemPreparedEventArgs>(treeView_ItemPrepared);  
 
void treeView_ItemPrepared(object sender, RadTreeViewItemPreparedEventArgs e)  
{  
    var treeViewItem = e.PreparedItem;  
 
    //The level property is what you need:  
    var level = treeViewItem.Level  

Hopefully this will work for you,

All the best,
Miroslav
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
Balaram Barange
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
Share this question
or