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

Show Current/Previous Month With Multiview Columns

4 Answers 98 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Levi
Top achievements
Rank 1
Levi asked on 24 Jul 2010, 05:57 AM
I was wondering how I show the Current Month and Previous Month when setting MultiviewColumns="2".... Currently it shows the current and next month which doesn't work well for my application. The user can only select dates up to the current date.

Levi

4 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 26 Jul 2010, 06:08 AM
Helo Levi,


Set the FocusedDate property of RadCalendar from code behind, as shown below to achieve the appearance.

C#:
protected void Page_Load(object sender, EventArgs e)
{
    RadCalendar1.FocusedDate = DateTime.Now.AddMonths(-1);
}


-Shinu.
0
Levi
Top achievements
Rank 1
answered on 26 Jul 2010, 02:27 PM
Is there a way to do this client side? I have an Ajax application and need to do this anytime the calendar is displayed. I looked at the clientapi but I only see a get function. If I have this then I can check if it's an odd month and call the function. Thanks.

I tried this but nothing happens:
     var calendar = $find("<%=RadCalendar1.ClientID%>");
     calendar.set_focusedDate(2000, 1, 1);
0
Accepted
Cori
Top achievements
Rank 2
answered on 26 Jul 2010, 05:38 PM
You should use the navigateToDate function, since it will move the calendar to the passed date.

Here's the documentation file that says how to use it:
http://www.telerik.com/help/aspnet-ajax/calendar_clientsideradcalendar.html

I hope that helps.
0
Levi
Top achievements
Rank 1
answered on 27 Jul 2010, 02:21 PM
Both the server side and client side implementation are working great, so thank you both.
Tags
Calendar
Asked by
Levi
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Levi
Top achievements
Rank 1
Cori
Top achievements
Rank 2
Share this question
or