I am trying to add special days dynamically, I have set the template of the special day via aspx, and I am trying to assign it the dates with code on DayRender event. Thing is, it's not happening.
The aspx code goes:
<telerik:DayTemplate ID="DisableTemplate" runat="server">
<Content>
<div class="rcTemplate rcDayDisabled">
</div>
</Content>
</telerik:DayTemplate>
the css:
.RadCalendar_Special .rcRow .rcDayDisabled
{
background:0 0 no-repeat url(Disabled.gif);
}
the c#:
protected void RadCalendar1_DayRender(object sender, Telerik.Web.UI.Calendar.DayRenderEventArgs e)
{
if (e.Day.Date < DateTime.Now.Date)
{
RadCalendarDay RadDay = new RadCalendarDay();
RadDay.TemplateID = "DisableTemplate";
RadDay.Date = e.Day.Date;
e.Cell.CssClass = "rcDayDisabled";
RadCalendar1.SpecialDays.Add(RadDay);
}
}
also I noticed that without the property: Repeatable="DayInMonth" filled the special day will not appear... is there a solution to these problems: