Well, I know how the control works. I know its possibilities. What I'm
trying to tell is that it does not work in a standard way. None of the
standard controls are validated through anything else but string from
input. I don't say, that there is a bug or so. I say, that you could
consider making an extension of RadDateInput, so that it would offer the
string from its input instead of ValidationDate property. It would be
the right way. Now, invalid values cannot be validated on the server,
because when invalid date is entered on client side, there is and empty string on server side.
Your conclusion in the 2nd paragraph is not right. It is a "String" which is to be validated, not "DateTime?"...
"So to make sure the RadDateTimePicker or its DateInput have valid dates
for values, you only need to check if the SelectedDate property is set
or not, right?"
Let's consider a non-mandatory STANDARD
date input and if
- user lets it empty, it's VALID. (controlValidationValue variable in EvaluateIsValid() method must be an empty string)
- user fills in "ASDF", it's INVALID. (controlValidationValue variable in EvaluateIsValid() method must be "ASDF")
- user fills in "05/14/2010", it's VALID. (controlValidationValue variable in EvaluateIsValid() method must be "05/14/2010")
After postback, the STANDARD
input box is empty, contain "ASDF" or "05/14/2010" respectively, so that the user can correct his/her input.
Now let's see how RadDateInput
- user lets it empty, it is found valid - CORRECT
- user fills in "ASDF", it is found valid - FAIL
- user fills in "05/14/2010", it is found invalid - FAIL
After postback, the RadDateInput box is empty, empty, or contains "05/14/2010" respectively, so the input "ASDF" is lost (2nd point), or validation reports an error (3rd point). Only keeping RadDateInput empty works good, but it can't do the rest of the job.
RadDateInput now behave in an unexpectable way. It fails in 2 of 3 tests in use with standard server validation.
PS: I made a sample web application with standard datetime validator,
but how can I attach it to my message without renaming it to .jpg, .gif