只需要增加CellContentClick事件
private void dgvInbox_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex == 0)
{
// Force the update of the value for the checkbox column.
// Without this, the value doens't get updated until you move off from the cell.
dgvInbox.Rows[e.RowIndex].Cells[0].Value = (bool)dgvInbox.Rows[e.RowIndex].Cells[0].EditedFormattedValue;
}
}