DataGridViewCheckBoxCell how to show checked when set during form load
问题 I have a DataGridView that loads data from a DataTable, along with an unbound column of DataGridViewCheckBoxCells. The rows in the DataGridView are compared with a separate DataTable with values the user has saved, and if there is a match, the checkbox for that row should check. Here is the code that compares the values and sets the checkbox value to 'true': foreach (int j in selectedObjectives) { foreach (DataGridViewRow r in dgvObjectives.Rows) { if (j == Convert.ToInt32(r.Cells[