Its normal to have the DGV ignoring zeros ?
If the value of the string is: '23,00' in the DGV it will be showed as '23'
but if it is '23,23' it will appear as '23,23' is that normal ?
Printable View
Its normal to have the DGV ignoring zeros ?
If the value of the string is: '23,00' in the DGV it will be showed as '23'
but if it is '23,23' it will appear as '23,23' is that normal ?
Yes that is quite normal. After all, 23,00 is just 23. It's also 23,0 and 23,0000000 and 00023 as well. A number is just a number. If you specifically want the column to display two decimal places then you have to configure it to do so using its DefaultCellStyle.
Actually, I see that you said:If it really is a a String then that does seem a little odd. How EXACTLY is this data being retrieved and placed in the grid?Quote:
If the value of the string is: '23,00' in the DGV it will be showed as '23'
Thanks for answering,
I wrote this
and I could get the '0.23' appearing but it still omits the '23.00'vb Code:
DGV.Columns(4).DefaultCellStyle.Format = "0.00\%"
I just fill the DGV like this
vb Code:
da.Fill(ds, "products") DGV.DataSource = ds DGV.DataMember = "products"