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.
Unfortunately, activation email could not send to your email. Please try again.

gridcontrol date format

Thread ID:

Created:

Updated:

Platform:

Replies:

103245 Apr 16,2012 03:41 PM Apr 23,2012 08:09 AM Windows Forms 3
loading
Tags: GridControl
Smitha
Asked On April 16, 2012 03:41 PM

Hi,

I am working on this grid control. For displaying Datetime values, i want the datetime format to change as per the country.
Eg: India dd/mm/yyyy time: 24hr format
Us: mm/dd/yyyy time:24 hrs
So always the time is 24 hr format but the date formats are as per the country

Thanks
S


Mercy C [Syncfusion]
Replied On April 18, 2012 08:05 AM

Hi Smitha,

Thanks for your interest in Syncfusion products.

please make use of "QueryCellFormattedText" event to set the format and culture.

void gridControl1_QueryCellFormattedText(object sender, Syncfusion.Windows.Forms.Grid.GridCellTextEventArgs e)
{
if (e.Style.CellValueType == typeof(DateTime))
{
if (e.Value != null)
{
e.Text = ((DateTime)e.Value).ToString("HH:mm:ss:ff", new CultureInfo("en-In"));
e.Handled = true;
}
}
}

Please refer to the sample in the following link
http://www.syncfusion.com/downloads/Support/DirectTrac/92112/WindowsFormsApplication85-131721773.zip

Please let me know if you have any concerns.

Regards,
Mercy.C


Smitha
Replied On April 18, 2012 02:10 PM

Thanks Mercy.



Mercy C [Syncfusion]
Replied On April 23, 2012 08:09 AM

Hi Smitha,

Thanks for your update.

Please let me know if you have any concerns.

Regards,
Mercy.C


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.

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.

;