Toby
Posted
on Jun 3, 2010
(permalink)
Hi,
Hopefully a quick question:
With the calendar control there is a SelectedDate property which allows me to get/set a date to be highlighted/selected. However i need to highlight/select a daterange from code. There is a selectedDates property, which allows you to get a List<DateTime> of selected dates, however i need to set this. Is there a way to do this?
Many thanks,
Reply
Rick Glos
Posted
on Jun 3, 2010
(permalink)
I'm interested in the answer to this as well. According to the documentation, this is bindable - see
here.
But when attempting to use it you get an error.
Or if you try and set in code you get an error.
Reply
Toby
Posted
on Jun 4, 2010
(permalink)
Your link to the documentation got me thinking. I tried the following as a work around:
It would be helpful to be able to directly bind to a list, or set the list directly, however this should achieve the same thing.
Reply
Rick Glos
Posted
on Jun 4, 2010
(permalink)
Interesting, I didn't think to use the methods hanging off the IList. This would certainly give us a work-around. Although like you, I was hoping to bind this directly to my ViewModel. It would involve a bit of code hanging off the event handlers on the control to keep this list updated in both directions.
Telerik, can you tell us was this an oversight, making this property ReadOnly or done purposely? It would help us determine a course of action.
Reply
Answer
Kaloyan
Kaloyan
Posted
on Jun 8, 2010
(permalink)
Hello Rick Glos,
As you have noticed the property has a readonly accessor. You need to use the Add() method in order to add dates. We will consider adding an ItemsSource property that can be used with MVVM pattern.
Best wishes,
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.
Reply
Robert
Posted
on Jan 18, 2011
(permalink)
Hello Everybody,
Any news about ItemsSource property in RadCalendar ?
Reply
Kaloyan
Kaloyan
Posted
on Jan 21, 2011
(permalink)
Hello Toby,
There is no such a property exposed by the RadCalendar yet. You can create an attached property that will add a new selected date into the calendar itself and use it as a binding target. Let us know if you need any further explanation.
Kind regards,
Kaloyan
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it.
Learn more>>
Reply