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.

Cell value not formatting properly

Thread ID:





45132 Jun 12,2006 10:32 PM Jun 13,2006 12:09 AM Windows Forms 1
Tags: GridControl
Terence Rossow
Asked On June 12, 2006 10:32 PM

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 12:09 AM

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


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.