SelectedItem Bindable in MVVM

6 posts, 0 answers
  1. Andrea Ferrari
    Andrea Ferrari avatar
    9 posts
    Member since:
    Apr 2010

    Posted 10 Jul 2010 Link to this post

    Hi.
    Just a question: The SelectedItem is not bindable to a property in the ViewModel on a MVVM pattern?

    If not, how to get the selectedItem in the ViewModel?
    I need becouse I've to manage the add and remove buttons.

    Thanks and regards.

    Andrea
  2. Ваня
    Ваня avatar
    35 posts
    Member since:
    Nov 2008

    Posted 11 Jul 2010 Link to this post

    Hi,Andrea Ferrari

    Please,see the following thread,I believe that it could be useful for you
    http://social.msdn.microsoft.com/Forums/en/wpf/thread/d9439546-95bf-41b6-ad5c-62fa41f17cb3

    Hope this helps!
  3. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 15 Jul 2010 Link to this post

    Hi Andrea,

    There should be no problem binding the SelectedItem property of RadTreeView. The attached project demonstrates element binding between a ListBox and a TreeView. Also, I'd suggest you go through the link that Vanya previously posted.

    Regards,
    Kiril Stanoev
    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
  4. Adrian
    Adrian avatar
    2 posts
    Member since:
    Aug 2019

    Posted 23 Aug 2019 in reply to Ваня Link to this post

    Hello,

     

    I managed to delete the treeviewitem item (thanks to your post), but I wanted to create a DependencyProperty that should be using the ICommand and listen to the SelectedItemChanged event on the TreeView. How can I do this?

  5. Adrian
    Adrian avatar
    2 posts
    Member since:
    Aug 2019

    Posted 23 Aug 2019 in reply to Ваня Link to this post

    Ваня said:Hi,Andrea Ferrari

    Please,see the following thread,I believe that it could be useful for you
    http://social.msdn.microsoft.com/Forums/en/wpf/thread/essays.agency/thread/d9439546-95bf-41b6-ad5c-62fa41f17cb3

    Hope this helps!

    Hello,

    I managed to delete the treeviewitem item (thanks to your post), but I wanted to create a DependencyProperty that should be using the ICommand and listen to the SelectedItemChanged event on the TreeView. How can I do this?

  6. Martin Ivanov
    Admin
    Martin Ivanov avatar
    2602 posts

    Posted 23 Aug 2019 Link to this post

    Hello Adrian,

    To achieve your requirement you can use the EventToCommandBehavior. This will allow you to bind an ICommand to the SelectionChanged event of RadTreeView.

    Regards, Martin Ivanov
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top