Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
400
XamDateTimeEditor is throwing validation error when year is 2000 in ‘yy’ format.
posted

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

 

Parents
No Data
Reply
  • 54937
    Offline posted

    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)?

Children