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

OnMonthChanged equivalent

6 Answers 99 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Duncan
Top achievements
Rank 1
Duncan asked on 12 Nov 2008, 12:43 PM
I need to capture an event when the next or prev month is selected, because of the postback nature of this action - I used to use the above event with ASP.NET control - how can I do something similar with RAD Calendar?

6 Answers, 1 is accepted

Sort by
0
Duncan
Top achievements
Rank 1
answered on 12 Nov 2008, 03:53 PM
Thought I should be more specific about my problem. I'm using 

"sDate = ((

MonthView)CalAfrica.CalendarView).MonthStartDate;" in Page_Load() in order to get a parameter for my database driven events, and the date being picked up is from the previous view (ie. previous month navigated) . If I could pick up the start date of the month I have navigated to, that would be good. I suspect it's something to to with the order of events on the page?

 

0
Daniel
Telerik team
answered on 13 Nov 2008, 02:02 PM
Hello Duncan,

The appropriate event corresponding to VisibleMonthChanged is DefaultViewChanged.

You can find more information in the following demo:
RadCalendar Server-Side Events

Best regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Duncan
Top achievements
Rank 1
answered on 14 Nov 2008, 03:05 PM
Daniel,

thanks for your response. I had found my way to DefaultViewChanged but the problem now is that I have set FastNavigation to '12' so that ">>" takes me forward a year, but  e.NewView.ViewStartDate is only moving forward by 2/3 weeks. Is there a setting I've missed?
0
Duncan
Top achievements
Rank 1
answered on 14 Nov 2008, 05:01 PM
I've worked out the last question . e.NewView.ViewStartDate  was showing the first visible date on the calendar which was in the previous month. (and  e.NewView.ViewEndDate was in next month)  Is there any way to force the calendar to only show the days of the month (so that ViewStartDate is the 1st)? 

Also, if in the code-behind of the page holding the calendar, I don't seem to be able to 'jump' to a month in the non-postback scenario. IE. first time in, MonthStartDate defaults to the beginning of today's month. How can I change this? IE. call and render the calendar page with (say) a parameter of '01/12/2008' when we are in November? I know once the calendar has been rendered you can navigate where you like, but what about rendering a future month on first pass?
0
Duncan
Top achievements
Rank 1
answered on 15 Nov 2008, 04:59 PM
Could i use the Client-side event Onload() to jump to a future month on first rendering of the calendar? Perhaps reference a date Session object eg. <%=Session["startdate"]%> in the javascript function?
0
Daniel
Telerik team
answered on 17 Nov 2008, 03:32 PM
Hello Duncan,

Alternative approach would be to use the FocusedDate property:
<telerik:RadCalendar ID="RadCalendar1" runat="server" FocusedDate='<%# yourexpression %>' 

Regards,
Daniel
the Telerik team

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