I use a DateTimePicker on a WPF application. I would like to bind the .Text property to the SelectedDate, so I use binding like this:
<DatePicker x:Name="DateTimePicker_Date"
Text="{Binding dDate, Mode=TwoWay,
UpdateSourceTrigger=PropertyChanged,
TargetNullValue='',
ValidatesOnDataErrors=True}"
TabIndex="3"
Grid.Column="1" />
My problem is I use an European culture, so: DAY/MONTH/YEAR instead of MONTH/DAY/YEAR, so if I input : 14/02/2013
, I have a validation error !
How can I solve this?
Solved :
Juste add a :
this.Language = XmlLanguage.GetLanguage("fr-FR");
In the code-behind of the windows :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With