Show Current/Previous Month With Multiview Columns

5 posts, 2 answers
  1. Levi
    Levi avatar
    53 posts
    Member since:
    Jun 2010

    Posted 24 Jul 2010 Link to this post

    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
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 26 Jul 2010 Link to this post

    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.
  3. Levi
    Levi avatar
    53 posts
    Member since:
    Jun 2010

    Posted 26 Jul 2010 Link to this post

    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);
  4. Answer
    Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 26 Jul 2010 Link to this post

    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.
  5. Levi
    Levi avatar
    53 posts
    Member since:
    Jun 2010

    Posted 27 Jul 2010 Link to this post

    Both the server side and client side implementation are working great, so thank you both.
Back to Top