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

Add additional accepted string conversions

1 Answer 34 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Mattias
Top achievements
Rank 1
Mattias asked on 24 May 2013, 08:09 AM
The RadDatePicker is really cool and useful. We would like to add additional supported string formats for when the user types a date manually. This does not affect how dates are displayed, only how edit mode is treated.

I tried to do this by assigning a Converter, but that doesn't trigger until after the RadDatePicker has already converted the string into a date. :(

Is there any way I can override a property or implement an event or something that lets me help the RadDatePicker decode strings to dates of my choice?

* A real example: User types "20130524" without hyphens and I return todays date; "2013-05-24".
* Another (silly) example: User types "in three days" and I return today + 3 days; "2013-05-27".

1 Answer, 1 is accepted

Sort by
0
Kalin
Telerik team
answered on 29 May 2013, 09:54 AM
Hi Mattias,

In order to implement custom logic for parsing the date value, you should use ParseDateTimeValue event of the DateTimePicker. You can define the desired scenarios in the event handler in the code behind. For more detailed information regarding custom parsing please see the How to implement custom parsing article from our documentation.

Hope this helps.

Regards,
Kalin
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
DatePicker
Asked by
Mattias
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Share this question
or