Calendar DayRender event fires but doesn't update RadDateTimePicker

2 posts, 0 answers
  1. Ahmed
    Ahmed avatar
    9 posts
    Member since:
    Jan 2011

    Posted 13 Feb 2011 Link to this post

    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">

    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?

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 15 Feb 2011 Link to this post

    Hello Ahmed,

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

Back to Top