I have a datagrid and a datatable . Values in datagrid came from datable. Now the cell values is in decimal
and I want to change the format to 2 decimal places but here's my problem not all cell values is integer also it contain STRING VALUE
like N/A
.
Here's my sample datagrid filled with data:
Name | Col1 | Col2 |
-----------------------------------------
xxx | N/A | N/A |
yyy | 12.1999999 | 23.012355 |
zzz | 0.12366666 | 12.357878 |
I already tried
datagrid.columns(1).DefaultCellStyle.Format = "N2"
datagrid.columns(2).DefaultCellStyle.Format = "N2"
but the cell values didn't change the format, I know the problem there is the cell value contain string. There is other way to bypass that string?