if (dtbl.Rows.Count > 0)
foreach (DataRow row in dtbl.Rows)
{
DataGridViewComboBoxCell cbCell = (DataGridViewComboBoxCell)dgvLicenseMembers.Rows[0].Cells["dgvCmbNationality"];
cbCell.DataSource = dtbl;
cbCell.DisplayMember = "CountryName";
cbCell.ValueMember = "CountryID";
cbCell.Items.Add(row["CountryName"].ToString()); // ! Getting ERROR -Items collection cannot be modified when the DataSource property is set.
}
sqlCon.Close();
}
4 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Amit GuptaPosted Dec 21, 2016, 2:31 PM
Bikesh SrivastavaPosted Dec 21, 2016, 12:28 PM
Bineesh ViswanathPosted Dec 21, 2016, 6:21 AM
Mohammed Deeb HammoudehPosted Dec 21, 2016, 4:55 AM