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

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

1 Answer 65 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
kumar S
Top achievements
Rank 1
kumar S asked on 09 Dec 2009, 12:41 PM
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.

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 09 Dec 2009, 01:27 PM
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.
Tags
Calendar
Asked by
kumar S
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or