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

DatePicker - format date as you type

1 Answer 57 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 19 Oct 2010, 12:19 PM
Hi. I am looking at replacing an old calendar control with the date picker. The old one was similar in that it had a text box and an icon to pop up a calendar.

One feature that I cannot replicate in the DatePicker control is that when you typed it formatted the date for you. the DatePicker does this at the end, but we also need it to do it when you type.

For example if you wanted to enter the date 01/02/2010

you would type
01
then the control adds the /
then you type
02
then the control adds the /
then you type
10
and it formats the year to 2010

is this possible? as i say, the DatePicker does this on blur, so i guess the functionality is already there.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 19 Oct 2010, 01:27 PM
Hello James,


I believe you can achieve this functionality by making use of client side api. Attach 'OnKeyPress' event to RadDatePicker - DateInput, and check for the text and add the formatting character accordingly.

The following links will be of help:
Client-Side Basics
RadDatePicker Client Object


-Shinu.
Tags
Calendar
Asked by
James
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or