Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how can i set a data grid view control in visual basic .NET to allow the first digit in a numeric cell to be 0?
Posted

1 solution

Here's an article which explains how to pad numeric values with zeroes.
http://msdn.microsoft.com/en-us/library/dd260048.aspx[^]

As you are using a data grid view, you need to set the default cell style:
DataGridViewName.Columns("ColumnName").DefaultCellStyle.Format = "D6"

That would pad the integer with zeroes to six digits. I'm assuming that you want to align the values.

If this isn't what you are looking for, let us know.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900