|
-
Sep 22nd, 2011, 06:52 AM
#1
Thread Starter
Member
DataGridView omits zeros
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 ?
-
Sep 22nd, 2011, 07:58 AM
#2
Re: DataGridView omits zeros
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.
-
Sep 22nd, 2011, 08:00 AM
#3
Re: DataGridView omits zeros
Actually, I see that you said:
If the value of the string is: '23,00' in the DGV it will be showed as '23'
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?
-
Sep 22nd, 2011, 05:41 PM
#4
Thread Starter
Member
Re: DataGridView omits zeros
Thanks for answering,
I wrote this
vb Code:
DGV.Columns(4).DefaultCellStyle.Format = "0.00\%"
and I could get the '0.23' appearing but it still omits the '23.00'
I just fill the DGV like this
vb Code:
da.Fill(ds, "products") DGV.DataSource = ds DGV.DataMember = "products"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|