Setting server system date as current date to a RAD:DatePicker

2 posts, 1 answers
  1. kumar S
    kumar S avatar
    7 posts
    Member since:
    Aug 2012

    Posted 09 Dec 2009 Link to this post

    Hi,

        I want to show "Server machine" system date as "Current Date" in a "RAD:DatePicker". Suppose "Server System" date is "23/12/2009". and "Client System" date is "22/12/2009" then I want to high light "23/12/2009" as current date, When DatePicker Popup is opened. Following is code  snippet setting style to high light "Today's date in picker.

       <SpecialDays>
                                        <telerik:RadCalendarDay Repeatable="Today" Date="" ItemStyle-CssClass="rcToday" />
                                    </SpecialDays>

    Thanks in Advance,
    Kumar.
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 09 Dec 2009 Link to this post

    Hello Kumar,

    You can set today's date from code behind as shown below.

    CS:
     
        protected void RadDatePicker6_Load(object sender, EventArgs e) 
        { 
            RadDatePicker6.SelectedDate = DateTime.Now.Date;  
            // Code for adding special daya from code behind 
            //RadCalendarDay cDay = new RadCalendarDay(); 
            //cDay.Date = DateTime.Now.Date; 
            //cDay.ItemStyle.CssClass = "rcToday"; 
            //RadDatePicker6.Calendar.SpecialDays.Add(cDay);       
        } 

    -Shinu.
Back to Top