in a datagrid view, if I add a custom row (not binding to anything at all):
how can I set the format of the value column?Code:this.theDataGridView.Columns.Add("Value", "Value"); this.theDataGridView.Columns.Add("Name", "Name"); string[] rows = new string[2]; rows[0] = "5.236"; rows[1] = "blah"; this.theDataGridView.Rows.Add(rows);
I know that this works:
this.theDataGridView.Columns["Value"].DefaultCellStyle.Format = "#.##";
but only when you are binding to a datasource, such as SQL.
If I apply this at any point in the code, it still does not format the column, to give me the format as follows:
x.xx -> 5.23
any ideas?





any chance of a regain? 
Reply With Quote