1

I'm building an C# application using WPF/MVVM and I have some trouble using a DateTime in a DataGrid.

The column is defined as

<DataGridTextColumn Header="Start" Binding="{Binding StartDate, StringFormat=dd-MM-yyyy}" />

The code works fine with a date like 05-08-2011, which has a leading zero. But, when I try to enter a date without the leading zero (like 15-08-2011) the field won't validate. Why is that?

StartDate is of type DateTime.

Christian Tang
  • 1,450
  • 4
  • 19
  • 30

1 Answers1

1

I guess should be the invalid culture. Probably the validation consider the month first, then the day. Check you PC settings.

Mario Vernari
  • 6,649
  • 1
  • 32
  • 44