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

checked event

1 Answer 34 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Aurore
Top achievements
Rank 1
Aurore asked on 19 Jul 2010, 04:09 PM
Hello,

I'd like to catch the checked/unckecked item.

As you describe in your documentation : http://www.telerik.com/help/wpf/telerik.windows.controls.navigation-telerik.windows.controls.radtreeview-unchecked_ev.html

I've tried this :

void RadTreeView1_Unchecked(object sender, RadRoutedEventArgs e)
{
   // get a reference to the item that has been unchecked
   RadTreeViewItem uncheckedItem = e.Source as RadTreeViewItem;
        if (uncheckedItem == null) return;
        SphItem oItem = uncheckedItem.DataContext as SphItem;
        if (oItem != null && OnUncheckedItem != null) OnUncheckedItem(oItem);

}


But uncheckedItem is always null.

If I use e.Originalsource, i get a RadTreeViewItem, but not the leaf one.
image my tree is like this :
part1
  |--- elt1
  |--- elt2
I unchecked elt2, i obtain part1 in my datastructure SphItem...

Thanks for your help
Aurore

1 Answer, 1 is accepted

Sort by
0
Valentin.Stoychev
Telerik team
answered on 20 Jul 2010, 03:04 PM
Hi Aurore,

If you are binding the TreeView you need to get the OriginalSource.

If you are using the checkboxes in TriState mode - you will receive events for all the items that has been checked ( not only the item that was clicked by the user).

Please let us know if you need more help.

Sincerely yours,
Valentin.Stoychev
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
Aurore
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
Share this question
or