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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Thread ID:

Created:

Updated:

Platform:

Replies:

94214 Apr 29,2010 05:05 PM UTC May 19,2010 06:58 AM UTC WinForms 5
loading
Tags: GridControl
vehfl
Asked On April 29, 2010 05:05 PM UTC

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"

vehfl
Replied On 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?

Jisha Joy [Syncfusion]
Replied On 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

vehfl
Replied On May 6, 2010 03:07 PM UTC

Hi,
sorry but it's not help me(

vehfl
Replied On 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"

Arulraj A [Syncfusion]
Replied On 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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;