tags:

views:

1119

answers:

4

WPF Toolkit, How to apply date format in C# for datepicker control?

A: 

The datepicker in WPF Toolkit allow only Short and Long formats. You can use as

datePicker.SelectedDateFormat = Microsoft.Windows.Controls.DatePickerFormat.Long;
datePicker.SelectedDateFormat = Microsoft.Windows.Controls.DatePickerFormat.Short;
Sauron
these are system defined .. we require custom date format
Jaswant Agarwal
A: 

I found the one way to solve of my problem by using the culture

System.Globalization.CultureInfo culInfo = new System.Globalization.CultureInfo("en-us");

System.Globalization.DateTimeFormatInfo dtinfo = new System.Globalization.DateTimeFormatInfo();

dtinfo.ShortDatePattern = "dd-Mon-yyyy";

dtinfo.DateSeparator = "-";

And apply this short date pattern to date time picker..it works

Jaswant Agarwal
A: 

And apply this short date pattern to date time picker..it works

How can I do it?

Kamilos