Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

Commented Unassigned: FormatException was unhandled by user code. String was not recognized as a valid DateTime [21635]

$
0
0
Hi,

I have changed the system DateTime format as dd/mm/yyyy hh:mm:tt.
Whenever this format is used, DateTimePicker control crashes[Exception StackTrace attached].

The issue is DateTime.Parse method is used to convert the string value to DateTime Format, which will give exception for some custom formats. According to my investigation you can use DateTime.TryParse instead to convert which will not throw any exception.
Comments: ** Comment from web user: BoucherS **

Hi,

I cannot reproduce the crash in v2.3. Here's my XAML :
```
<xctk:DateTimePicker Format="Custom"
FormatString="dd/mm/yyyy hh:mm:tt"
Height="25"
Width="150"/>
```
What version of the toolkit do you have ? What is different from you in my XAML ?


Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>