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: Swamy2712 **

Hi,

I set the system time format as follows:
Short time : HH:mm:tt
Long Time : HH:mm:ss:tt

and used the below xml for Time picker. I'm using v2.0 but I also checked with v2.3 and the same issue exists.

```
<xckt:TimePicker Name="TimePickerCtrl" Format="Custom" FormatString="dd/mm/yy hh:mm:tt" ShowButtonSpinner="False" Height="20" Width="40" Value="{Binding Timevalue}"/>
```


Viewing all articles
Browse latest Browse all 4964

Trending Articles



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