The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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
ADAdministrator Syncfusion Team 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