Click to See Complete Forum and Search --> : Setting Default value OR Null value in DataGridView


laxatcg1
March 12th, 2007, 01:49 PM
I have a Databound DataGridView displayed in my form. I need to set the default value for some of the columns and when the user enters then that value had to be overwritten. How do I do that?

I went to DataGridView - Edit column and checked the properties and in CellStyleBuilder I set the NullValue to 'False' for one of the CheckBox column but doesn't seem to have any impact. It's not reflecting in DB. Please help me out. Thank you!

My working environment is: VS2005 / SQL / VB / Windowsapp.

aniskhan
March 12th, 2007, 03:02 PM
try this DataGridView1.Columns("ColumnName").DefaultCellStyle.NullValue = "Default Value"