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 : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

gridcontrol date format

Thread ID:

Created:

Updated:

Platform:

Replies:

103245 Apr 16,2012 07:41 PM UTC Apr 23,2012 12:09 PM UTC WinForms 3
loading
Tags: GridControl
Smitha
Asked On April 16, 2012 07:41 PM UTC

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 12:05 PM UTC

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 06:10 PM UTC

Thanks Mercy.



Mercy C [Syncfusion]
Replied On April 23, 2012 12:09 PM UTC

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.

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

;