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

TreeView expanded Item

1 Answer 56 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Sravan Kumar Uddarraju
Top achievements
Rank 1
Sravan Kumar Uddarraju asked on 29 Sep 2010, 06:43 PM

Hi,

I have RadTreeview and its Itemtemplates has Checkboxs on it. When I expand the TreeView item (without selecting), events (of the checkbox) with in the Itemtemplates are getting fired and failing code due to there are no selected item in Treeview.

 

My question is there any property for getting expanded item (index) when I expand the treeview node?

Regards,
Kumar

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 04 Oct 2010, 12:28 PM
Hello Sravan Kumar Uddarraju,

 
The way to get the index of the TreeViewItem that you have just expanded is to handle one of the events:  RadTreeView.Expanded (for all treeViewItems) or RadTreeViewItem.Expanded (for a particular one). It should be something like this:

private void radTreeView_Expanded(object sender ,Telerik.Windows.RadRoutedEventArgs e)
    {
        RadTreeViewItem currentExpanded = e.OriginalSource as RadTreeViewItem;
        int index = currentExpanded.Index;
         
        //Do your index logic here...
    }

You may also find it useful to know that you can detect the Initially checked TreeViewItem when the tree is in tristate mode.  In this case you can handle the Checked  event of the TreeViewitem  and use the IsUserInitiated boolean property.

Hope this helps  you . Please let us know if we can further assist you.


Sincerely yours,
Petar Mladenov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
TreeView
Asked by
Sravan Kumar Uddarraju
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or