We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

How I can set "en-Us" DateTime format in grid?

I set for datetime column "en-Us" datetime format:

GridControl.TableDescriptor.Columns[index].Appearance.AnyRecordFieldCell.Format = CultureInfo.CurrentUICulture.DateTimeFormat.ShortDatePattern+ " " + System.Globalization.CultureInfo.CurrentUICulture.DateTimeFormat.ShortTimePattern;

but instead of format "M/d/yyyy hh:mm tt" i see datetime in format "M.d.yyyy hh:mm tt", for example for datetime in "en-Us" "2/14/2010 11:00" I get "2.14.2010 11:00"

5 Replies

VE vehfl May 4, 2010 10:26 AM UTC

for additional information: the language of OS is Russian and short datetime format is 'dd.mm.yyyy'.
Probably that this bug is linked to it?


JJ Jisha Joy Syncfusion Team May 6, 2010 05:48 AM UTC

Hi,

Thank you for your interest in Syncfusion products.

You could try the following code snippets to apply format for DateTime cells and please let me know if this helps.

gridGroupingControl1.TableDescriptor.Columns["date"].Appearance.AnyRecordFieldCell.CellValueType = typeof(DateTime);
gridGroupingControl1.TableDescriptor.Columns["date"].Appearance.AnyRecordFieldCell.Format = "MM/dd/yyyy";

Regards,
Jisha


VE vehfl May 6, 2010 03:07 PM UTC

Hi,
sorry but it's not help me(


VE vehfl May 6, 2010 03:21 PM UTC

but I have noticed that when I set date format in OS as "dd/mm/yyyy" that in this case datetime format in grid for "en-us" cunture is "mm/dd/yyyy"...
for example if OS datetime format "13/6/2010" (13 june 2010), that grid form is correct "6/13/2010"


AA Arulraj A Syncfusion Team May 19, 2010 06:58 AM UTC

Hi Vehlf,

Thanks for your interest in Syncfusion Products.

You can solve this by setting the Culture at the application level. This can be done by the below code on Form1_load method.

Application.CurrentCulture = new System.Globalization.CultureInfo("es-ES");


Here is a sample for your reference.
http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=DateFormat-1625427466.zip

Regards,
Arulraj.A

Loader.
Live Chat Icon For mobile
Up arrow icon