Had the same problem for datagridviews, that are bounded to a BindingSource. Manifests after deleting the last row in the datagridview - if a row is added by typing in values, not all cells have default values set. Effect is not related to column order or visibility; in my case, one integer column value was set, but another was not. A string value was also set ok. Maybe the bug related to the datatype - works one time for each datatype?
The problem was solved as follows: to set initial cell values, instead DatagridView.DefaultValuesNeeded event use BindingSource.AddingNew event. At least, it worked for me.
If there is a similar event for DataTable, it might also work.
|