loop through datagridview column and check checkbox

后端 未结 1 821
借酒劲吻你
借酒劲吻你 2021-01-24 19:37

I have a DataGridView with four columns: Eng, Swe, update and hide.

End and Swe are normal strings and update and hide are checkboxes.

I want to make two butto

1条回答
  •  無奈伤痛
    2021-01-24 20:20

        private void UpdateAllButton_Click(object sender, EventArgs e)
        {
            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                row.Cells["update"].Value = true;
            }
        }
    
        private void HideButton_Click(object sender, EventArgs e)
        {
            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                row.Cells["hide"].Value = true;
            }
        }
    

    0 讨论(0)
提交回复
热议问题