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

Data binding SelectedItems property

3 Answers 513 Views
TimeLine
This is a migrated thread and some comments may be shown as answers.
ben crinion
Top achievements
Rank 1
ben crinion asked on 15 Jul 2013, 10:24 AM
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.

3 Answers, 1 is accepted

Sort by
0
Petar Kirov
Telerik team
answered on 18 Jul 2013, 08:36 AM
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 >>
0
ben crinion
Top achievements
Rank 1
answered on 18 Jul 2013, 11:29 AM
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
0
Petar Kirov
Telerik team
answered on 22 Jul 2013, 02:50 PM
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 >>
Tags
TimeLine
Asked by
ben crinion
Top achievements
Rank 1
Answers by
Petar Kirov
Telerik team
ben crinion
Top achievements
Rank 1
Share this question
or