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

Client Keyboard Shortcut TimePicker

1 Answer 65 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
GDPR_erased
Top achievements
Rank 1
GDPR_erased asked on 30 Apr 2010, 07:59 PM
I'm using the TimePicker, and was wondering if there is a way to simply type "n" for "now" (current datetime)?
Are there any shortcuts for the control?
I want the input empty until they enter a time. I do not want it to default to today or anything.
Thanks in advance for the suggestions.
~bg

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 03 May 2010, 02:36 PM

Hello Bill,

You can add the OnKeyPress event to RadTimePicker, and select the custom time according to the key pressed. Here is an example.

APSX:

 
<telerik:RadTimePicker ID="RadTimePicker1" runat="server">  
    <DateInput>  
        <ClientEvents OnKeyPress="OnKeyPress" />  
    </DateInput>  
</telerik:RadTimePicker> 

JavaScript:

 
    var timepicker;  
    var dt = new Date();  
    function OnKeyPress(sender, args) {  
        timepicker = sender;  
        if (args.get_keyCode() == 110) {  
            setTimeout("timepicker.set_selectedDate(dt);", 100);  
        }  
    }  

-Shinu.

Tags
Calendar
Asked by
GDPR_erased
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or