I have added a lookup combobox to my datagridview. Any changed to an existing row or adding a new row changed the value in RowState on save to Modified or Added. except changing a value in the combobox. On save, the RowState remains as unmodified.
the code i use to add the combobox is.
DataGridViewComboBoxColumn cbQualification = new DataGridViewComboBoxColumn();
cbQualification.HeaderText = "Course Code";
DataSet myDataSet = GetData.GetCoursesData();
cbQualification.DataSource = myDataSet.Tables[0];
cbQualification.DisplayMember = "Code";
cbQualification.ValueMember = "ID";
cbQualification.DataPropertyName = "QualID";
grdPersonQuals.Columns.Insert (1,cbQualification);
the save event uses the code.
grdPersonQuals.BindingContext[grdPersonQuals.DataSource, grdPersonQuals.DataMember].EndCurrentEdit();
foreach (DataRow row in dsPersonQuals.Tables[0].Rows)
{
object x = row.RowState;
}