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

Month Navigation & DayRender

7 Answers 170 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Dave Whiting
Top achievements
Rank 1
Dave Whiting asked on 28 Jul 2008, 01:51 PM
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

7 Answers, 1 is accepted

Sort by
0
Dave Whiting
Top achievements
Rank 1
answered on 30 Jul 2008, 01:24 PM
bump...

Has anyone any idea how i may fix this please?

Thanks
Mark
0
Iana Tsolova
Telerik team
answered on 30 Jul 2008, 02:33 PM
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.
0
Peter
Top achievements
Rank 1
answered on 07 Feb 2013, 05:11 AM
My DayRender event doesn't fire when I navigate to another month... what's the fix?
0
Angel Petrov
Telerik team
answered on 11 Feb 2013, 03:21 PM
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.
0
Peter
Top achievements
Rank 1
answered on 12 Feb 2013, 12:13 AM
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.
0
Angel Petrov
Telerik team
answered on 14 Feb 2013, 02:23 PM
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.
0
Peter
Top achievements
Rank 1
answered on 14 Feb 2013, 11:29 PM
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. 
Tags
Calendar
Asked by
Dave Whiting
Top achievements
Rank 1
Answers by
Dave Whiting
Top achievements
Rank 1
Iana Tsolova
Telerik team
Peter
Top achievements
Rank 1
Angel Petrov
Telerik team
Share this question
or