Data binding SelectedItems property

4 posts, 0 answers
  1. ben crinion
    ben crinion avatar
    8 posts
    Member since:
    Nov 2009

    Posted 15 Jul 2013 Link to this post

    How do I databind the SelectedItems property? I'm just getting the following compilation error and can't find any examples of how it's done in the documentation

    The property "SelectedItems" does not have an accessible setter.

  2. Petar Kirov
    Admin
    Petar Kirov avatar
    425 posts

    Posted 18 Jul 2013 Link to this post

    Hi Ben,

    The RadTimeline.SelectedItems property works like the SelectedItems properties of other WPF controls, like ListBox, that is - it supports only operations defined by the IList interface like adding, removing and clearing. If you want to programmatically change the selected items, you can keep a reference this collection in your ViewModel and update it  from there.

    Regards,
    Petar Kirov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. ben crinion
    ben crinion avatar
    8 posts
    Member since:
    Nov 2009

    Posted 18 Jul 2013 Link to this post

    How can I keep a reference to it in my ViewModel if I can't bind to it in the XAML? Please could you provide an example?

    Thanks
  5. Petar Kirov
    Admin
    Petar Kirov avatar
    425 posts

    Posted 22 Jul 2013 Link to this post

    Hi Ben,

    Actually you can create a Behavior in order to synchronize the RadTimeline.SelectedItems property with a similar property in your ViewModel. Here you can see how the same is achieved with a ListBox. You should be able to port that code to your project with minimal changes.
     
    Regards,
    Petar Kirov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top