dataGridView中的反向选择, checkbox

来源:互联网 发布:知乎越来越垃圾 编辑:程序博客网 时间:2024/05/20 08:23
private void reversed_ToolStripMenuItem_Click(object sender, EventArgs e)
{
    foreach ( DataGridViewRow drw in this.dataGridView1.Rows)
    {
        this.textBox1.Focus();
        if (drw.Cells[0].Value == null)
        {
            drw.Cells[0].Value = true;
        }
        else
        {
            drw.Cells[0].Value = !(bool)drw.Cells[0].Value;
        }
    }

}


原创粉丝点击