Click here to Skip to main content
15,891,733 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
i have column Name Amount where I enter a numeric value like 1000. I want to format it like 1000.00 after the user has entered the value.

Thanks in Advance

Lakhan
Posted
Updated 20-Jan-12 19:43pm
v2

try this ...
C#
this.dataGridView1.Columns["YourColumn"].DefaultCellStyle.Format = "{0:F2}";


Format Data in the Windows Forms DataGridView Control[^]
 
Share this answer
 
Comments
Prashant Srivastava LKO 21-Jan-12 4:01am    
Gud answer my 5
ambarishtv 21-Jan-12 4:10am    
thank u Parshant
In the forms designer click the grid, then edit columns, select your column, edit the defaultcellstyle format property to N2.
 
Share this answer
 
v2

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