{
//here we will add the combo box's selected event changed ComboBox cmbBox;
if (NaardataGridView2.CurrentCell.ColumnIndex == 0)
{
cmbBox = e.Control as ComboBox;
if (cmbBox == null) { return; }
cmbBox.SelectedIndexChanged += cmbBox_SelectedIndexChanged;
}
}
void cmbBox_SelectedIndexChanged(object sender, EventArgs e)
{
int rowNr = NaardataGridView2.CurrentRow.Index;
ComboBox cmbBox = (ComboBox)sender;
NaardataGridView2.Rows[rowNr].Cells[4].Value = Convert.ToString(cmbBox.SelectedIndex);
}