实现效果:

  禁止DataGridView控件中添加和删除行

知识运用:

  DataGridView控件的AllowUserToAddRows

  AllowUserDeleteRows和ReadOnly属性

实现代码:

        private void btn_no_Click(object sender, EventArgs e)
        {
            dataGridView1.AllowUserToAddRows = false;
            dataGridView1.AllowUserToDeleteRows = false;
            dataGridView1.ReadOnly = true;
        }

  

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2022-02-09
  • 2022-12-23
  • 2021-07-27
猜你喜欢
  • 2022-12-23
  • 2021-11-11
  • 2021-10-02
  • 2022-01-07
  • 2022-01-10
  • 2022-02-06
相关资源
相似解决方案