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

Change Value to "Today" When User Enters Invalid Input

1 Answer 60 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
keith schaefer
Top achievements
Rank 1
keith schaefer asked on 19 Oct 2010, 01:08 PM
Our product owner has told us that if the user enters bad data, the date control must display the current date rather than become blank. The value must be initialized to null (and stay null if the user tabs over without entering a value), but upon an invalid date selection it must change to the current day.

How can I accomplish this using the RadDatePicker? I tried to find an event that triggers when the user has entered a value (at the point you are internally validating the input), but so far have not been able to find anything.

1 Answer, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 20 Oct 2010, 10:56 AM
Hello Keith,

Thank you for contacting us.

To achieve your goal you can use the ParseDateTimeValue event and implement your custom logic for validation. Set the desired date as an argument of the ParseDateTimeEventArge property and mark the IsParsingSuccessful to true.

Hope this information helps. If you have any other questions about our controls please let us know.

All the best,
Konstantina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
DatePicker
Asked by
keith schaefer
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Share this question
or