OnMonthChanged equivalent

7 posts, 0 answers
  1. Duncan
    Duncan avatar
    5 posts
    Member since:
    Nov 2008

    Posted 12 Nov 2008 Link to this post

    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?
  2. Duncan
    Duncan avatar
    5 posts
    Member since:
    Nov 2008

    Posted 12 Nov 2008 Link to this post

    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?

     

  3. Daniel
    Admin
    Daniel avatar
    4949 posts

    Posted 13 Nov 2008 Link to this post

    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.
  4. Duncan
    Duncan avatar
    5 posts
    Member since:
    Nov 2008

    Posted 14 Nov 2008 Link to this post

    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?
  5. Duncan
    Duncan avatar
    5 posts
    Member since:
    Nov 2008

    Posted 14 Nov 2008 Link to this post

    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?
  6. Duncan
    Duncan avatar
    5 posts
    Member since:
    Nov 2008

    Posted 15 Nov 2008 Link to this post

    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?
  7. Daniel
    Admin
    Daniel avatar
    4949 posts

    Posted 17 Nov 2008 Link to this post

    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.
Back to Top