I think this is a bug that we can input invalid date. Although the validation can check this value.
I hope we can prevent user from inputting this invalid date.
Thanks
Hello,
You can hook to TextChanged event. And here is the event code:
private void XamDateTimeEditor_TextChanged(object sender, RoutedPropertyChangedEventArgs<string> e)
{
if (dateTime.Mask == "{date}")
if (dateTime.Text == "02/30/")
dateTime.Text = "";
}
This will prevent you from typing '02/30/____'.
Hope this helps.
Regards,
Anastas
Hi,
Let me add one other thought. If you add the following code a message will automatically be displayed for an invalid date.
xamDateTimeEditor1.InvalidValueBehavior = InvalidValueBehavior.DisplayErrorMessage;
I don't know if you noticed that if you drop down the calendar, the date that is actually chosen is today's date when an invalid date is entered.