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

CalendarView: how to display a no default month

2 Answers 78 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Marco Baldacchini
Top achievements
Rank 1
Marco Baldacchini asked on 06 Feb 2009, 10:20 AM
Hi, I need some help with Calendar control:

My objective is - at loading an aspx page (not postback) - to display one month of my choose, and not the current month that is displayed by default. I think that this is possible, but I can't find out how to do it.

Thanks

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 06 Feb 2009, 12:22 PM
Hi Marco,

Set the FocusedDate property of RadCalendar to desired date in order to show that monthview instead of current month. The FocusedDate property specifies the date that has focus. By default, RadCalendar uses the current date as the focused date. See the example.

ASPX:
<telerik:RadCalendar ID="RadCalendar1" Runat="server" FocusedDate="12/12/2008">  
</telerik:RadCalendar> 

You can also set the FocusedDate property from server side.
CS:
protected void Page_Load(object sender, EventArgs e)  
{  
    if (!IsPostBack)  
    {  
        DateTime MyDate = new DateTime(2008, 05, 05); // Choose the date  
        RadCalendar1.FocusedDate = MyDate;  
    }  

Thanks,
Princy.
0
Romualdo Lodovici
Top achievements
Rank 2
answered on 06 Feb 2009, 01:12 PM
It works perfectly.
Thanks a lot
Tags
Calendar
Asked by
Marco Baldacchini
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Romualdo Lodovici
Top achievements
Rank 2
Share this question
or