Set Calendar to different month after postback

2 posts, 0 answers
  1. Padmasree
    Padmasree avatar
    1 posts
    Member since:
    Oct 2008

    Posted 24 Oct 2008 Link to this post

    Hello,

    I would like to reset the calendar of the RadCalendar to a different month after page postback. Is it possible to do? By default the RadCalendar reset the Calendar to the current calendar month.

    I tried setting the CurrentViewBeginDate and CurrentViewEndDate properties. But it didn't work and i always see the RadCalendar reset to current calendar month.

    RadCalendar1.CalendarView.CurrentViewBeginDate = (

    DateTime)ViewState["RadCStartDate"];

     

     

    if(ViewState["RadCEndDate"] != null)

     

    RadCalendar1.CalendarView.CurrentViewEndDate = (

    DateTime)ViewState["RadCEndDate"];

    Any feedback will be appreciated.

    Thanks
    Padma

     

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 31 Oct 2008 Link to this post

    Hi Padmasree,

    You can try the following code snippet to reset the calender to the desired month.

    CS:
     protected void Button1_Click(object sender, EventArgs e) 
        { 
            DateTime date = new DateTime(2001, 01, 01);  // set the desired date
            RadCalendar1.FocusedDate = date
     
        } 


    Thanks,
    Shinu
Back to Top