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

Set Calendar to different month after postback

1 Answer 59 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Padmasree
Top achievements
Rank 1
Padmasree asked on 24 Oct 2008, 03:22 PM
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

 

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 31 Oct 2008, 11:56 AM
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
Tags
Calendar
Asked by
Padmasree
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or