This is a migrated thread and some comments may be shown as answers.
Calendar DayRender event fires but doesn't update RadDateTimePicker
1 Answer 50 Views
This is a migrated thread and some comments may be shown as answers.
Ahmed
Top achievements
Rank 1
Ahmed asked on 13 Feb 2011, 11:43 AM

I use the following code for creating RadDateTimePicker control.

<telerik:RadDateTimePicker runat="server" ID="dtDate">
  <DateInput runat="server" ID="dtDateInput" DisplayDateFormat="MM/dd/yyyy hh:mm tt">
</DateInput></telerik:RadDateTimePicker>

Within Page_Load event, I use DayRender event of Calendar object of RadDateTimePicker control.

dtDate.Calendar.DayRender += new global::Telerik.Web.UI.Calendar.DayRenderEventHandler(Calendar_DayRender);

The following event run successfully, but doesn't update control, means days that match condition still enabled.

void Calendar_DayRender(object sender, global::Telerik.Web.UI.Calendar.DayRenderEventArgs e)
{
  DateTime dtCurrentDate = e.Day.Date;
  if (dtCurrentDate.Month == 2)
    {
       e.Cell.CssClass = "rcOutOfRange";
       e.Day.IsDisabled = true;          
  }
}

Any ideas how to resolve that issue?

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 15 Feb 2011, 12:13 PM
Hello Ahmed,

I have found this forum and code library discussed similar scenario.
disabling calendar weekend days
Disabling calendar days

Thanks,
Shinu.
Asked by
Ahmed
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Share this question
or