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

MVVM Observable Collection with Calendar SelectedDates

6 Answers 312 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Teresa
Top achievements
Rank 2
Teresa asked on 11 Oct 2010, 10:16 PM
I would like to bind SelectedDates in the calendar to an ObservableCollection exposed via my View Model but I only see SelectedDate available as a two way binding and not SelectedDates.   I don't really want to two way bind to the observable collection but without this capability, the collection does not seem to be visible to bind to.  I can wire to the onchange event in code.  That may be the right way to do it but it feels wrong so I thought I would check.

6 Answers, 1 is accepted

Sort by
0
Kaloyan
Telerik team
answered on 14 Oct 2010, 09:10 AM
Hello Teresa,

It is not possible to bind the SelectedDates property as it is marked as a read only. Let us know if you need any further help.

Regards,
Kaloyan
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
0
Michael
Top achievements
Rank 1
answered on 16 Nov 2010, 05:05 PM
You documentation on this property reads as follows:

"The SelectedDates collection is an observable collection (although it is exposed as an IList) which contains the currently selected dates and can be used in binding."

Note the last 5 words.
You need to update that so I don't waste hours building a UI with the expectation that this will work.
0
Kaloyan
Telerik team
answered on 18 Nov 2010, 02:39 PM
Hi Michael,

Thank you for the comments. We will update the online help shortly. As a solution you can expose a custom attached property of Dates and set binding through it.

Sincerely yours,
Kaloyan
the Telerik team
See What's New in RadControls for Silverlight in Q3 2010 on Tuesday, November 16, 2010 11:00 AM - 12:00 PM EST or 10:00 PM - 11:00 PM EST: Register here>>
0
saw
Top achievements
Rank 1
answered on 13 Jan 2015, 07:05 AM
Any way to bind SelectedDates into ViewModel ObservableCollection<DateTime> ?
0
Nasko
Telerik team
answered on 13 Jan 2015, 12:35 PM
Hello Shalin,

With current version of RadCalendar it is not possible to bind the SelectedDates property to a Collection of DateTime objects because it is a read only property. We have already logged this feature request in our feedback portal and you can easily track its status on the following link:
http://feedback.telerik.com/Project/143/Feedback/Details/87989-add-selecteddates-dependency-property

However, as a workaround we could suggest you to check the following blog post that demonstrates how to create an additional property for the SelectedDates property and thus to achieve the desired:
http://blogs.telerik.com/xamlteam/posts/11-06-13/using-the-multiple-selection-of-the-radcalendar-control-for-silverlight-and-wpf-with-mvvm.aspx

We hope this will help you.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
saw
Top achievements
Rank 1
answered on 14 Jan 2015, 03:58 AM
I just used "SelectionChanged" in radCalendar,
ViewModel.SelectedDates = this.Calendars.SelectedDates;
Tags
Calendar
Asked by
Teresa
Top achievements
Rank 2
Answers by
Kaloyan
Telerik team
Michael
Top achievements
Rank 1
saw
Top achievements
Rank 1
Nasko
Telerik team
Share this question
or