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

Changing viewed month

2 Answers 61 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Rune
Top achievements
Rank 2
Rune asked on 28 Sep 2009, 12:10 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Schlurk
Top achievements
Rank 2
answered on 28 Sep 2009, 02:56 PM
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! :)
0
Rune
Top achievements
Rank 2
answered on 29 Sep 2009, 06:43 AM
Great. That worked like a charm.

Thanks a lot.

Rune
Tags
Calendar
Asked by
Rune
Top achievements
Rank 2
Answers by
Schlurk
Top achievements
Rank 2
Rune
Top achievements
Rank 2
Share this question
or