Hello,
I have a screen with the date picker. User will select a date.
Under button click another page will be shown in popup. This page will have calender. In its page load I am preselecting the date which the user has already selected in the main screen. User shouldn't be able to unselect that preselected date.
I used the following code disable the selection
// if you are using the skin bundled as a webresource("Default"), the Skin property returns empty string
string calendarSkin = RadCalendar1.Skin != "" ? RadCalendar1.Skin : "Default";
string otherMonthCssClass = String.Format("otherMonth_{0}", calendarSkin);
// disable the selection for the specific day
RadCalendarDay calendarDay = new RadCalendarDay();
calendarDay.Date = transactionDate; //the date which has to be preselected
calendarDay.IsSelectable = false;
calendarDay.ItemStyle.CssClass = otherMonthCssClass;
RadCalendar1.SpecialDays.Add(calendarDay);
//Pre select the transaction date selected in the entry screen
RadCalendar1.SelectedDates.Add(new RadDate(transactionDate));
The probelm here is
After page load, the transactionDate is preselected which is fine. If I change the month, select different dates and come back to the month having preselected date, then I see that it is not preselected. Its selection is still disabled but it is not highlighted.
If I put just this code
RadCalendar1.SelectedDates.Add(new RadDate(transactionDate));
and remove the code where the date is disabled, then everything works fine.
Any help would be appreciated,
Thanks,
AV
I have a screen with the date picker. User will select a date.
Under button click another page will be shown in popup. This page will have calender. In its page load I am preselecting the date which the user has already selected in the main screen. User shouldn't be able to unselect that preselected date.
I used the following code disable the selection
// if you are using the skin bundled as a webresource("Default"), the Skin property returns empty string
string calendarSkin = RadCalendar1.Skin != "" ? RadCalendar1.Skin : "Default";
string otherMonthCssClass = String.Format("otherMonth_{0}", calendarSkin);
// disable the selection for the specific day
RadCalendarDay calendarDay = new RadCalendarDay();
calendarDay.Date = transactionDate; //the date which has to be preselected
calendarDay.IsSelectable = false;
calendarDay.ItemStyle.CssClass = otherMonthCssClass;
RadCalendar1.SpecialDays.Add(calendarDay);
//Pre select the transaction date selected in the entry screen
RadCalendar1.SelectedDates.Add(new RadDate(transactionDate));
The probelm here is
After page load, the transactionDate is preselected which is fine. If I change the month, select different dates and come back to the month having preselected date, then I see that it is not preselected. Its selection is still disabled but it is not highlighted.
If I put just this code
RadCalendar1.SelectedDates.Add(new RadDate(transactionDate));
and remove the code where the date is disabled, then everything works fine.
Any help would be appreciated,
Thanks,
AV