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

Formatting Double cellType

Thread ID:





73187 Apr 24,2008 06:23 AM UTC May 8,2008 01:35 AM UTC WinForms 2
Tags: GridControl
Jamilah Abdul Rashid
Asked On April 24, 2008 06:23 AM UTC


I'm creating an application that have a grid which user can change the cell format similar to Excel.

The only issue is, if a cell's CellValueType is set to Double, whenever user apply customize format (i.e "mm:ss"), the cell text will display the format text itself. This is undesirable.

CellValueType = typeof(Double)
CellText = 101
Format = "mm:ss"

Displayed Text = mm:ss

In Excel, the cell value is converted to a DateTime value and then applies the format. Is there a way I can achieve this? or Is there a way I can block applying the format so that it won't display the format text itself?

Attached is the sample showing this issue.

Please help.

Jamilah Abdul Rashid


Administrator [Syncfusion]
Replied On May 2, 2008 09:51 AM UTC

Hi Jamilah,

Thanks for the interest in Syncfusion products.

You can set the format of the DateTime using the GridStyleInfo property. Please refer the following code snippet that shows how we can set the format of the DateTime value.

GridStyleInfo style = this.gridControl1.Model[2, 2];
style.CellValueType = typeof(DateTime);
style.Format = "mm:ss";
style.CellValue = DateTime.Now;

Please refer the sample in the below link that illustrates the above.


Please let me know if this helps.


Administrator [Syncfusion]
Replied On May 8, 2008 01:35 AM UTC

Thanks Asem.
You gave an idea on fixing this.


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

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