I have a date column in a datagrid in my silverlight App. I need the time to be displayed in 24 hr format. To achieve this I have modified the UI culture in Application_Startup event like this:
CultureInfo cinf = Thread.CurrentThread.CurrentUICulture.Clone() as CultureInfo;
DateTimeFormatInfo f = cinf.DateTimeFormat.Clone() as DateTimeFormatInfo;
System.Globalization.DateTimeFormatInfo df = new System.Globalization.DateTimeFormatInfo();
string format = "MM/dd/yyyy HH:mm:ss";
f.FullDateTimePattern = format;
cinf.DateTimeFormat = f;
Thread.CurrentThread.CurrentUICulture = cinf;
But the UI always picks up the datatime format specified in my regional settings on my OS. Any pointers?