I have a DataGridView and I set the EditMode to EditOnEnter. I am also using the DefaultValuesNeeded event to poplulate each column in the row. If I tab accross the new row and off of the DataGridView the new record is not added and when I set focus back on the DataGridView a System.InvalidOperationException is thrown. But if I set the EditMode to EditOnKeyStroke this error does not occur.
Is this a bug or is there something else I should be doing when the user tabs off the new row If this is by design what should I do to avoid the exception

DataGridView Problems Adding New Row
pratdevil
Can you provide more details on your scenario Is the DataGridView databound what are the column types Do you have any hidden columns Any primary keys < xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
-mark
DataGridView Program Manager
Microsoft
This post is provided "as-is"
Lyle Hardin
I'm binding to an object datasource and only 3 columns exist in the grid. Two columns have datagridview combo boxes and one is a text box. None of the columns are primary keys.
Edra Buckles
Do you perform any validation in your business objects The new row actually creates an instance of your object and sets the properties to the default values you provide. So you have to ensure that the default values valid for your business object. In addition, since you are using combobox columns you have to make sure the default values are considered valid for the combo box columns as well.< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
EDIT: Marking as answered. Please reply and/or remove the answered tag if further assistance is needed
-mark
DataGridView Program Manager
Microsoft
This post is provided "as-is"