Reputation: 31
I used string.format() for a column in datagridview to separate thousands with comma but
in cases that the value is zero "0" the datagridview's cell don't show zero and cell is empty
dataGridView2.Columns[7].ValueType = typeof(string);
dataGridView2.Columns[7].DefaultCellStyle.Format = string.Format("#,#", System.Globalization.CultureInfo.InvariantCulture) ;
please help me
regards
Upvotes: 0
Views: 4741
Reputation: 20544
From MSDN:Custom Numeric Format Strings
So I changed the expression to #,0
, and it worked:
Upvotes: 1