private void dataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex == 0)
{
int rowInde = e.RowIndex;
if ((Convert.ToBoolean(dataGridView.Rows[rowInde].Cells[0].Value) == true))
{
dataGridView.Rows[rowInde].Cells[0].Value = "False";
}
else {
dataGridView.Rows[rowInde].Cells[0].Value = "True";
}
int num = 0;
for (int i = 0; i < dataGridViewt.Rows.Count; i++)
{
Console.WriteLine(Convert.ToBoolean(dataGridView.Rows[i].Cells[0].Value));
if ((Convert.ToBoolean(dataGridView.Rows[i].Cells[0].Value) == true))
{
num = num + 1;
}
else {
continue;
}
}
this.labelSelectNum.Text = "(已选" + num + "条)";
}
}