I have a DatePicker
object in a DataGrid
that successfully shows the date from the database or a property:
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<DatePicker SelectedDate="{Binding Date, StringFormat=dd/MM/yyyy}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
Now I want to show the time in front of the date. This is what I tried, but it doesn't work:
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<DatePicker SelectedDate="{Binding Date, StringFormat='dd/MM/yyyy HH:mm:ss'}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
NOTE: I do not want to do this in the code-behind.
Use the extended DateTimePicker