DatePicker and CultureInfo

Nov 4, 2008 at 9:31 PM

 

Hi,

I’m not so familiar with the Xaml in Wpf.

How to set the CultureInfos ShortDatePattern for the DatePicker.SelectedDateFormat in Xaml and how to create a DataGridTemplateColumn at runtime?

 

Thanks in advance.

WorstCase

Coordinator
Nov 4, 2008 at 11:38 PM
Have you tried setting the SelectedDateFormat attribute in your DatePicker XAML tag to "Short"?

-Eric Fabricant, MSFT
Nov 5, 2008 at 2:52 PM
Thanks,
Does the DatePicker supports DateFormat accordingly to the current culture?
Nov 5, 2008 at 6:37 PM

Sorry, my misstake. Yes, DatePicker does, the underlying TextBox in a DataGridCell does not.

I don’t know how to set the StringFormat of the TextBox to set something like that:            

TextBox.StringFormat = CultureInfo.DateTimeFormat.ShortDatePattern;

 

Thanks in advance.

WorstCase