Hello Jyoti,
Problem is RadCalendar does not coerce its DisplayDateStart, DisplayDate, DisplayDateEnd properly. For example the following code fails:
calendar.DisplayDate = DateTime.Today.Date.AddDays(3);
calendar.DisplayDateStart = DateTime.Today.Date.AddDays(4);
calendar.DisplayDateEnd = DateTime.Today.Date.AddDays(20);
while the following works:
calendar.DisplayDate = DateTime.Today.Date.AddDays(3);
calendar.DisplayDateStart = DateTime.Today.Date.AddDays(2);
calendar.DisplayDateEnd = DateTime.Today.Date.AddDays(20);
You could take for granted the default DisplayDateStart is smallest possible DateTime in the calendar, while the DisplayDateEnd is the last. Setting the DisplayDateStart to a day bigger than the DisplayDate will throw an exception. So as a workaround you could first set the DisplayDate to the value you desire and after set the DisplayDateStart and DisplayDateEnd.
If you are about to change these values more than once you could try to first clear the old Start and End values by setting the Start to a really small date and the End to really large (like the years 0001 and 3000), set the DisplayDate and then set the DisplayStartDate and DisplayEndDate to the real values.
I know this workaround is ugly but you could use it until we fix the value coercing.
Greetings,
Pana
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!