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

Cell value not formatting properly

Thread ID:

Created:

Updated:

Platform:

Replies:

45132 Jun 13,2006 02:32 AM UTC Jun 13,2006 04:09 AM UTC WinForms 1
loading
Tags: GridControl
Terence Rossow
Asked On June 13, 2006 02:32 AM UTC

Hi there, I have a cell that doesn''t seem to be formatting the way it should. Here is the GridStyleInfo to string: CellValue = ''67.8'' Font.Size = 10 Font.Bold = True CellValueType = System.Double Format = "C02" From that I would expect to see $67.80 - but it comes out as 67.8. Another cell in the same grid has this style info: CellValue = ''12667.7'' Font.Size = 10 CellValueType = System.Double Format = "#,##0.00" It formats correctly, as 12,667.70. I notice that the CellValue has in front of it and the problem one does not - is this the reason? Any ideas what I might be doing wrong? Cheers, TERRY ROSSOW

Administrator [Syncfusion]
Replied On June 13, 2006 04:09 AM UTC

Hi Terry, The reason is that you are assigning the string value to the cell in a grid. You need to assign the double value to the cell in a grid. Here is a code snippet. // 68.7 is the double value. this.gridControl1[3,3].CellValue = 68.7; this.gridControl1[3,3].CellValueType = typeof(System.Double); this.gridControl1[3,3].Format = "C02"; Let me know if this helps. Best Regards, Haneef

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

;