i can't seem to figure out how to select several days in my calendar.
I have a list of dates that i would like to select in my calendar. How can i do this?
I set the property AllowMultipleSelect tro true and tried something like that but no dates are selected:
For each myDate in DateList |
Me.RadCalendar1.SelectedDates.Add(myDate ) |
Next |
11 Answers, 1 is accepted

But i have another question: I would like to disable the days that are not in my DateList.
How can i do that?
thanks
You can get an instance of any cell element in RadCalendar and set its properties such as the Enabled property. When you set Enabled = false then you will no longer be able to select that cell using the mouse or the keyboard.
Here is sample code which disables all cells in RadCalendar
For Each cell As CalendarCellElement In (TryCast(Me.radCalendar1.CalendarElement.CalendarVisualElement, MonthViewElement)).TableElement.Children |
cell.Enabled = False |
Next cell |
You can check what is the current cell date using the Date property of CalendarCellElement class.
I hope that this will help you. Do not hesitate to contact me back if you have further questions.
Greetings,
Boyko Markov
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.


I tryed you solution and it works, but only in the current month.
when i navigate through my calendar, all the days are disable except the days in my date list.
I would like to enable only the days of the month in my dateList.
How can i do that?
i try this too but stil the same result
For Each myCell As UI.CalendarCellElement In RadCalendarStartDate.RootElement.Children(0).Children(0).Children(2).Children(0).Children(1).Children |
If Not Me.Dates.Contains(myCell.Date) Then |
myCell.Enabled = False |
End If |
Next |
thank you
Shirya
You could try also using the code (that disables cells) in the handler of the ViewChanged event of RadCalendar so that it is executed every time the user navigates to a different month.
You may also need to change the code a little bit so that it also enables cells for dates that are in your list.
I hope this helps.
All the best,
Jordan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.

Weekend and normal days do not have the same look when disabled. How can i have the same gray backcolor for all the disabled days (even if its not a weekend day) ?
I think this issue is theme related and I have a very simple workaround. You can set the color properties of the calendar cells: BackColor, BackColor2, BackColor3, BackColor4, GradientStyle, etc.
Please take a look at the sample code below:
foreach (CalendarCellElement cell in (this.radCalendar1.CalendarElement.CalendarVisualElement as MonthViewElement).TableElement.Children) |
{ |
cell.BackColor = Color.Green; |
} |
Please do not hesitate to contact me if you have any other questions regarding RadCalendar.
Regards,
Boyko Markov
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.

I want to disable all days except Monday for all Months in RAD dateTimePicker. I have wriiten the following Code but still able to select dates other than Monday...
public Form1()
{
InitializeComponent();
this.radDateTimePicker1.DateTimePickerElement.Opened +=new EventHandler(DateTimePickerElement_Opened);
}
private void DateTimePickerElement_Opened(object sender, EventArgs e)
{
CalendarTableElement table = ((this.radDateTimePicker1.DateTimePickerElement.GetCurrentBehavior() as
RadDateTimePickerCalendar).Calendar.CalendarElement.CalendarVisualElement.Children[0].Children[1] as
CalendarTableElement);
foreach (CalendarCellElement cell in table.Children)
{
cell.Enabled = true;
if (cell.Date.DayOfWeek != DayOfWeek.Monday)
{
cell.Enabled = false;
}
}
This cannot be done with the current implementation of RadCalendar. The selection cannot be canceled for a specific cell using the Enabled property. However this will be possible after we release the SP release this week.
Feel free to contact us again in case you have further questions after the SP1 release.
Best wishes,
Boyko Markov
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.

how can i do that.
example.
if i click on the calender icon of the date picker then the current month calender opens
but i need to open some other months calender.
how can i do it?
thanx in advance
Here is sample code which demonstrates how to show a month different than the current one when the user opens the RadCalendar popup in RadDateTimePicker:
1. Subscribe to the Opened event of the PopupControl
RadDateTimePickerCalendar calendarBehavior = this.radDateTimePicker1.DateTimePickerElement.GetCurrentBehavior() as RadDateTimePickerCalendar; |
calendarBehavior.PopupControl.Opened += new EventHandler(PopupControl_Opened); |
2. Set the calendar's FocusedDate property to any custom date.
void PopupControl_Opened(object sender, EventArgs e) |
{ |
DateTime myCustomDate = new DateTime(2000, 10, 20); |
RadDateTimePickerCalendar calendarBehavior = this.radDateTimePicker1.DateTimePickerElement.GetCurrentBehavior() as RadDateTimePickerCalendar; |
calendarBehavior.Calendar.FocusedDate = myCustomDate; |
} |
I hope this helps.
Sincerely yours,
Boyko Markov
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.