We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

DateTimeEdit - Handle invalid dates and out of range - DateValidationError

I'm looking to replace my DatePicker with the DateTimeEdit and I can't seem to find a analog to the DateValidationError event.

In other words, I need to be able to have a method called to display "Invalid Date" or "Date too early" or "Date too late" message to the user if the condition occurs.

Thanks!

2 Replies

DR David Rose December 31, 2012 09:36 PM UTC

Also, I'd like to be able to say "2/31/2012 is not a valid date". So I need to access the original entered value.


JR Jegan Raj M Syncfusion Team January 22, 2013 05:55 AM UTC

Hi David,

Sorry for the delay in getting back to you.

We have created a sample based on your requirement and you can download the sample from the below link.

In this sample, we have created the custom property Date to validate the DateTime in DateTimeEdit control through ValidatesOnDataErrors in binding and we have overriden the Validation border while DateTimeEdit control get focused by custom style which collapsed the FocusBorder and gives the validation style as you have required.

Please let us know if you have any queries.

Regards,
Jegan Raj M


DateTimeEditDemo_52c6acc4.zip

Loader.
Live Chat Icon For mobile
Up arrow icon