答案 0 :(得分:1)
如果datagridview像这样遍历行:
foreach (DataGridViewRow row in dataGridView1.Rows)
{
//Check Column 3 for quantity
if (row.Cells[3].Value.ToString() == "0")
{
//Get checkbox in column 1 and cast it to a checkbox
DataGridViewCheckBoxCell cell = row.Cells[1] as DataGridViewCheckBoxCell;
cell.Value = cell.TrueValue;
}
}