This is a migrated thread and some comments may be shown as answers.

OnDayRender not fired initially

1 Answer 49 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Jeff Nafe
Top achievements
Rank 1
Jeff Nafe asked on 16 Dec 2008, 03:42 PM
We have custom code in the client side OnDayRender event to disable all days except Mondays for certain situations. My problem is that this code runs when a month changes (causing a re-draw of the calendar), but it doesn't fire when the calendar initially loads upon the page loading. So, initially the non-Mondays are improperly enabled. Once I start navigating around, this code gets fired and I'm all good.

Is there a reason why this isn't fired initially. Is there a different event I can tap into to execute this same code for the initial month?

Thanks!

Jeff

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 19 Dec 2008, 01:30 PM
Hi Jeff,

Initially RadCalendar is rendered on the server and that is why OnDayRender client-side event is not raised. Possible approach is to register desired script using server-side DayRender event. Here is an example:
  
    void RadCalendar1_DayRender(object sender, Telerik.Web.UI.Calendar.DayRenderEventArgs e)
    {
        ScriptManager.RegisterStartupScript(Page, Page.GetType(), e.Day.Date.ToString(), "alert('RadCalendar1_DayRender');", true);
    }

Regards,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Calendar
Asked by
Jeff Nafe
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or