DatePicker and DataGridTemplateColumn

Nov 4, 2008 at 10:11 PM

Hi ,
First I want to thank you for the nice DataGrid and DatePicker. Now I’m trying to use it:


I want to use the approach of the WindowsClient.Net Hands On Labs sample called WPFFeaturesPreviewHOLOnline to get a DatePicker control inside a DataGrid_V1.


The problem is that the DatePicker or the cell respectively does not keep the date I've set.

In the Hands On Labs sample the date does not appear just after modifying.

In my application the modified date disappears after sorting any column.

In my application I bound a DataTable to the DataGrid_V1 itemsource.


Can anyone help, please?





Nov 5, 2008 at 7:59 AM
                            <dg:DatePicker SelectedDate="{Binding Date, Mode=TwoWay}" SelectedDateFormat="Short" />
Nov 5, 2008 at 3:26 PM
Hi Mike,
Thanks for your reply. With this modification it is working now in your sample application but not in my sample application.
After click on any column the date is the same as befor.

<dg:DatePicker Name="MyDatePicker" SelectedDate="{Binding Path=download_time, Mode=TwoWay}" SelectedDateFormat="Short" />

Does the DatePicker supports DateFormat accordingly to the current xulture?



Nov 19, 2008 at 8:17 PM
Edited Nov 19, 2008 at 8:20 PM
Yes, the DatePicker does. For example, try using 

Thread.CurrentThread.CurrentCulture = new CultureInfo("de-DE")

before your Calendar/DatePicker is created and check it out for yourself.

-Eric Fabricant, MSFT

Nov 19, 2008 at 10:45 PM
Thank you, Eric.
Yes, datepicker supports culture. Now I know some more details: Sorry, my mistake was the within the TextBox in the same cell (CellTemplate, EditingCellTemplate).

Now I need to set also the text 'Show calendar' depending on the culture in case that the date is not valid.

Nov 20, 2008 at 12:11 AM
This other thread relates to that aspect of the control and may help you out.

-Eric Fabricant, MSFT