checked event

2 posts, 0 answers
  1. Aurore
    Aurore avatar
    58 posts
    Member since:
    Nov 2007

    Posted 19 Jul 2010 Link to this post

    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
  2. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 20 Jul 2010 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top