实现效果:

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

知识运用:

  DataGridView控件的AllowUserToAddRows

  AllowUserDeleteRows和ReadOnly属性

实现代码:

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

  

04-27 01:02