Changing viewed month

3 posts, 1 answers
  1. Rune
    Rune avatar
    43 posts
    Member since:
    May 2009

    Posted 28 Sep 2009 Link to this post

    Hi,

    I am trying to find out how to change the viewed month of the calendar from the backend code. I need next and prev buttons that change both a Scheduler and the Calendar.

    When I set the calendars SelectedDate, the view is not updated to the month of the new date. How do I do this?

    Thanks,
    Rune
  2. Answer
    Schlurk
    Schlurk avatar
    812 posts
    Member since:
    May 2009

    Posted 28 Sep 2009 Link to this post

    I'm not sure if you're looking to change the month in the month-view or just standard view of the calendar but you could give this a try:

     
    protected void Button1_Click(object sender, EventArgs e)  
    {  
        RadCalendar1.FocusedDate = RadCalendar1.FocusedDate.AddMonths(1); 
    }  

    That would be for the Next button, replacing .AddMonths(1) with .AddMonths(-1) should give you the Previous month. Let me know if it works! :)
  3. Rune
    Rune avatar
    43 posts
    Member since:
    May 2009

    Posted 29 Sep 2009 Link to this post

    Great. That worked like a charm.

    Thanks a lot.

    Rune
Back to Top