You may prepared several datasources for each combobox,e.g, DS1,DS2...DSn,as well as a “collection datasource" which is the combined with DS1~DSn. Then change the datasource of cell being edit, after finishing edition, change the datasource back to CollectionDS
private void dataGridView1_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e)
{
if (e.ColumnIndex == this.ComboBoxColumn.Index)
{
// Set the combobox cell datasource to corresponding BindingSource
DataGridViewComboBoxCell dgcb = (DataGridViewComboBoxCell)dataGridView1
[e.ColumnIndex, e.RowIndex];
dgcb.DataSource = ds[e.RowIndex];
}
}
private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex == this.ComboBoxColumn.Index)
{
// Reset combobox cell to the collection BindingSource
DataGridViewComboBoxCell dgcb = (DataGridViewComboBoxCell)dataGridView1
[e.ColumnIndex, e.RowIndex];
dgcb.DataSource = CollectionDS;
}
}