全选

private void All_selected_Click(object sender, EventArgs e)
        {            
            for (int i = 0; i < this.DataGridViewProduct.Rows.Count; i++)
            {
                if (DataGridViewProduct.Rows[i].Cells["Check"].EditedFormattedValue.ToString().ToLower()=="false")
                {
                    DataGridViewProduct.Rows[i].Cells["Check"].Value = "True";
                }
            }            
        }

取消

 public void AllCancel()
        {
            foreach (DataGridViewRow row in DataGridViewProduct.Rows)
            {
                row.Selected = false;
            }
        }

 

相关文章:

  • 2022-12-23
  • 2022-02-02
  • 2022-12-23
  • 2021-05-03
  • 2022-02-22
  • 2021-09-25
  • 2021-08-03
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-06
  • 2021-10-10
相关资源
相似解决方案