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

How to select 'Select Date' on single click

1 Answer 66 Views
DataPager
This is a migrated thread and some comments may be shown as answers.
Abhay
Top achievements
Rank 1
Abhay asked on 04 Feb 2011, 05:54 PM
Hi All,

I am using 'RadDatePicker' in my web application. I am using following java script to display current date as selected date by default and this script is working fine. My problem is that for selecting selected date(which is by default current date) i have to click two time on same date, first click remove its selection and second click select it and display it in date picker. i just want to do selection of selectted date at single click.
Please help me its urgent.

function

 

CurrentDateSelection(sender, eventArgs) { 
 
        if (sender.get_selectedDate() == null) {
        eventArgs.set_cancelCalendarSynchronization(
true);
        
 var popup = eventArgs.get_popupControl();
        
 var todaysDate = new Date(); 
        
 var todayTriplet = [todaysDate.getFullYear(), todaysDate.getMonth() + 1, todaysDate.getDate()]; 
        popup.selectDate(todayTriplet,
true); 
     }
}

-----------------------------------------
 <telerik:RadDatePicker ID="RadDatePickerAnswerDate" runat="server" Width="110px"> 
<DateInput ID="DateInput25" runat="server" DateFormat="MM/dd/yyyy" /> 
<ClientEvents OnPopupOpening="CurrentDateSelection" />
</telerik:RadDatePicker>

 

 

 

 

 

 

 

 

 

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Pavel
Telerik team
answered on 10 Feb 2011, 09:12 AM
Hello Abhay,

You can highlight today's date in the calendar using the approach illustrated in this example. This will allow the date to be easily recognized by the user, and at the same time remain selectable.

All the best,
Pavel
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
DataPager
Asked by
Abhay
Top achievements
Rank 1
Answers by
Pavel
Telerik team
Share this question
or