Hi I'm using OnDayRender to disable special days.
so have added below code
<
telerik:RadDatePicker
Calendar-DayNameFormat
=
"Shortest"
Calendar-ShowOtherMonthsDays
=
"false"
DateInput-ReadOnly
=
"true"
DatePopupButton-ImageUrl
=
"/images/calander_icon.gif"
DatePopupButton-HoverImageUrl
=
"/images/calander_icon.gif"
ID
=
"rdpDeliveryDate"
OnLoad
=
"rdpDeliveryDate_Load"
runat
=
"server"
>
<
Calendar
ID
=
"Calendar1"
runat
=
"server"
ShowRowHeaders
=
"false"
OnDayRender
=
"dayRender"
ShowFastNavigationButtons
=
"false"
FirstDayOfWeek
=
"Sunday"
></
Calendar
>
</
telerik:RadDatePicker
>
CS:
protected
void
dayRender(
object
sender, Telerik.Web.UI.Calendar.DayRenderEventArgs e)
{
if
(e.Day.Date.DayOfWeek == DayOfWeek.Friday|| e.Day.Date.DayOfWeek == DayOfWeek.Saturday)
{
// clear the default cell content (anchor tag) as we need to disable the hover effect for this cell
e.Cell.Text =
""
;
e.Cell.CssClass =
"rcOutOfRange"
;
//set new CssClass for the disabled calendar day cells (e.g. look like other month days here)
// render a span element with the processed calendar day number instead of the removed anchor -- necessary for the calendar skinning mechanism
Label label =
new
Label();
label.Text = e.Day.Date.Day.ToString();
e.Cell.Controls.Add(label);
e.Cell.ToolTip =
"Day Off"
;
RadCalendarDay dayoff =
new
RadCalendarDay();
dayoff.Date = e.Day.Date;
dayoff.IsSelectable =
false
;
dayoff.IsDisabled =
true
;
dayoff.ItemStyle.CssClass =
"rcOutOfRange"
;
cln.SpecialDays.Add(dayoff);
}
}
I'm using Version 2015.2.826.45,
Visual studio 2012.
but still other month of special days showing in the calendar. please check the attached screen shot
appropriate for quick and best response.
Yasin