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

Bind to SelectedAppointments

2 Answers 173 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Cameron
Top achievements
Rank 1
Cameron asked on 07 Sep 2015, 08:35 AM

Hey,

 I am using a custom AppointmentSelectionBehaviour to prevent the user from selecting Appointments with more than 2 different resource types. This works correctly. The problem is that I wish to bind to the selected appointments. There is a property on the RadScheduleView called "SelectedAppointments" but I am not able to bind to it. Am I doing something wrong? I want to be able to modify the selected appointments in my view model. 

 Thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Nasko
Telerik team
answered on 08 Sep 2015, 08:47 AM
Hello Cameron,

The SelectedAppointments collection of RadScheduleView is a read-only dependency property that cannot be set and thus it cannot be bound to the ViewModel's property.

What we could suggest you is to use the EventToCommandBehavior and bound the AppointmentSelectionChanged event to a Command inside the ViewModel. So, every time an Appointment or a collection of Appointments gets selected the command will be called and inside t you will be able to retrieve all the selected appointments.

We have created a sample project that demonstrates that approach and you could run and evaluate it.

We hope this will help you.

Regards,
Nasko
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Cameron
Top achievements
Rank 1
answered on 08 Sep 2015, 12:38 PM

Hey Nasko,

 Thanks for that, it works great.

 Cameron

Tags
ScheduleView
Asked by
Cameron
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Cameron
Top achievements
Rank 1
Share this question
or