RadCalendar.SelectedDate is not working

3 posts, 1 answers
  1. Venkata
    Venkata avatar
    128 posts
    Member since:
    Nov 2009

    Posted 01 Feb 2011 Link to this post

    Hi,
    i have a RadCalendar control on my page.
    I am trying to set a RadCalendar selected date as March 15, 2011
    but always shows February month
    what i am doing wrong..?

    here is my code
    <telerik:RadCalendar runat="server" ID="RadCalendar1" ShowOtherMonthsDays="false" 
          EnableMonthYearFastNavigation="true" AutoPostBack="true">
    </telerik:RadCalendar>

    protected void Page_Load(object sender, EventArgs e)
      {          
         RadCalendar1.SelectedDate = DateTime.Parse("2011-03-15 11:02:00.000");
         //RadCalendar1.SelectedDate = DateTime.Parse("03/15/2011");
      }


    can any one help me?
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 01 Feb 2011 Link to this post

    Hello Venkata Maddineni,

    In order to achieve your requirement, you need to set the FocusedDate property along with the SelctedDate property. Check out the following code.

    C#:
    RadCalendar1.SelectedDate = DateTime.Parse("2011-03-15 11:02:00.000");
    RadCalendar1.FocusedDate= RadCalendar1.SelectedDate;

    Thanks,
    Shinu.
  3. Venkata
    Venkata avatar
    128 posts
    Member since:
    Nov 2009

    Posted 02 Feb 2011 Link to this post

    Thanks ..working..
Back to Top