I have a DataGridView which I have bound to a single ODBC database table using the Form Designer.
The ODBC source is an Informix database, and the relevant table contains an auto-incrementing column to generate the primary key for the table. There's another column which depends on a setting on the form. Both of these columns are set to Visible = False
.
When I allow the "Enable Adding" DataGridView setting and add a new row to the DataGridView I get the error that the second column does not allow nulls (which is correct).
Is there any way I can allow users to add rows directly to the DataGridView, and then programmatically set this missing value on, for example, an event, or do I have to resort to having an "Add New Row" button which adds a new row to the DataSource?