1、添加复选框
DataGridViewCheckBoxColumn DtCheck = new DataGridViewCheckBoxColumn();
DtCheck.DataPropertyName = "check";
DtCheck.HeaderText = "选择";
dataGridViewOperator.Columns.Add(DtCheck);
dataGridViewOperator.DataSource = Operator;
2、复选框全选
int index = dataGridViewOperator.Rows.Count;
for (int i = 0; i < index; i++)
{
DataGridViewCheckBoxCell checkCell = (DataGridViewCheckBoxCell)dataGridViewOperator.Rows[i].Cells[0];
Boolean flag = Convert.ToBoolean(checkCell.Value);
if (flag == false)
{
checkCell.Value = true;
}
else { continue; }
}