Hi,
If Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern is "dd-MMM-yy" I am getting “Value is invalid” error, when I tried to set the year to 00 using keyboard or using calendar popup (any date in year 2000).
<editors:XamDateTimeEditor Width="200"
FormatProvider="{Binding Source={x:Static thread:Thread.CurrentThread}, Path=CurrentCulture.DateTimeFormat}"
Mask="{}{date} {time}" VerticalAlignment="Bottom"/>
Is it a bug in XamDateTimeEditor ?
Is there is workaround for this situation?
Thanks,
Deep
You will get first chance (i.e. handled) exceptions when the mask is not satisfied. In your case you have a time section in the mask and selecting a date from the dropdown or typing in a date will not automatically fill in the value of the time section. Do these first chance exceptions continue after you have entered in something into the time section of the mask? Or are you saying that you are getting an unhandled exception (i.e. your app is crashing)?
For the Time mask I am handling it (means if the user has not entered any time manually then from code behind I will update time to 12 AM),My problem is with date, when I select any date in year 2000 say 02/02/2000 it is throwing this "Value is invalid" error (but app is not crashing as error is appearing in a message box.) and I can't enter manually a date like 02/02/00.This problem will remain even if I remove {Time} from Mask.
One possible way is to set
InvalidValueBehavior
="RetainValue" or
="RevertValue"
But by doing this I can only suppress the Error message I can't able to set the date to show 02/02/00. Hope you got my problem?