Month Navigation & DayRender

8 posts, 0 answers
  1. Dave Whiting
    Dave Whiting avatar
    41 posts
    Member since:
    Jan 2007

    Posted 28 Jul 2008 Link to this post

    Hi,

    I'm using the DayRender event to set styles for holidays and weekends on a radDatePicker containing a calendar with autopostback = true. I've then used AjaxManager to cause the DayRender to fire when the fast-navigation 'next month' button is clicked on the calendar.

    The problem I get is that the Ajax postback appear to fire but the calendar control (month view) disappears and the user has to click the calendar button on the datepicker again to bring it back. It does however display the next month which is what i needed. I need to stop the calendar hiding itself.

    Any idea how I could fix or work around this?

    Many Thanks
    Mark
  2. Dave Whiting
    Dave Whiting avatar
    41 posts
    Member since:
    Jan 2007

    Posted 30 Jul 2008 Link to this post

    bump...

    Has anyone any idea how i may fix this please?

    Thanks
    Mark
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 30 Jul 2008 Link to this post

    Hi Mark Broomfield,

    A scenario where the calendar of the date picker has AutoPostBack set to true is not supported by RadDatePicker.

    In order to implement the desired functionality, you could use the DayRender sever event of the calendar to customize the default calendar view. And implement the OnDayRender client-side event to customize the month view after navigation.

    Find more about DayRender event in the following online resources:
    http://www.telerik.com/DEMOS/ASPNET/Prometheus/Calendar/Examples/Programming/CustomDayCellRendering/DefaultCS.aspx
    http://www.telerik.com/help/aspnet-ajax/calendar_serversidedayrender.html
    http://www.telerik.com/help/aspnet-ajax/calendar_clientsideondayrender.html

    Let us know if you need further assistance.

    Regards,
    Iana
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Peter
    Peter avatar
    40 posts
    Member since:
    Mar 2012

    Posted 06 Feb 2013 Link to this post

    My DayRender event doesn't fire when I navigate to another month... what's the fix?
  6. Angel Petrov
    Admin
    Angel Petrov avatar
    1007 posts

    Posted 11 Feb 2013 Link to this post

    Hi Peter,

    Could you please elaborate more on which DayRender event does not fire the server-side or client-side? The server-side will be triggered if the AutoPostBack property of the calendar is set to true. As for the client-side in order to initially invoke the event you can do something like this:

    ASPX:
    <telerik:RadDatePicker runat="server"   ID="DatePicker1">
                <Calendar runat="server" >
                  <ClientEvents OnLoad="Load" OnDayRender="RenderADay" />
                </Calendar>
             </telerik:RadDatePicker>

    JavaScript:
    function RenderADay(sender, eventArgs)
           {
              //your logic
           }
    function
    Load(sender,eventArgs)
           {
               sender._moveToDate(sender.get_focusedDate(), true);
           }

    All the best,
    Angel Petrov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  7. Peter
    Peter avatar
    40 posts
    Member since:
    Mar 2012

    Posted 11 Feb 2013 Link to this post

    When I put AutoPostBack on the Date Picker's Calendar, the calendar pop-up displays when I click on it, but then the page posts-back and the pop-up closes. I've tried with both a RadAjaxManager and a RadAjaxPanel.
  8. Angel Petrov
    Admin
    Angel Petrov avatar
    1007 posts

    Posted 14 Feb 2013 Link to this post

    Hi Peter,

    When setting AutoPostBack the behavior that you experiencing is expected as Iana explained in her post. I suggest that you use the client-side OnDayRender event instead of the server-side as it fits your requirements better.

    Kind regards,
    Angel Petrov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  9. Peter
    Peter avatar
    40 posts
    Member since:
    Mar 2012

    Posted 14 Feb 2013 Link to this post

    Thanks for the reply Angel - As I said here, I'll just stick to using Special Days to get the behaviour I want and only use the DayRender event for the current month. 
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017