In Visual Studio 2008
- add a new DataGridView to a form
- Edit Columns
- Add a a new DataGridViewImageColumn
- Open the CellStyle Builder of this column (DefaultCellStyle property)
- Change the NullValue from System.Drawing.Bitmap to null
- Try to add a new Row to the DataGridView at runtime (dataGridView1.Rows.Add();)
- You get this error: System.FormatException: Formatted value of the cell has a wrong type.
If you change back the NullValue to System.Drawing.Bitmap (as it was) you still get the same error at adding a row.
If you set the NullValue at runtime instead of designtime you don't get anny error. (dataGridView1.Columns[0].DefaultCellStyle.NullValue = null;)
Could you tell me why is that?