If users are going to be typing dates as well as choosing from the dropdown calendar widget, where is the best event to trap the entered value, whether it was typed or picked, then warn users if the date fails some validation, and finally rollback the edit value to where it was if the user decides not to override the warning?
We need to allow dates in the past, but want to prevent accidental dates in the past, which typically occurs in the first few months of the new year after users have been accustomed to typing, say, 2011 for the entire year and then when the year changes to 2012, they type 2011 out of habit. So this validation would only be in effect for the first few months of the year, not year-round.
I don’t see how to rollback the value in EditValueChanged. The args don’t have a cancel option there. Is there another better event to do this that works with typed values and picked values?
Use the
EditValueChangingevent. It does have aCancelevent, along withNewValueandOldValue.