I'm using Visual Studio 2012. I want to disable the editing on the DataGridView
, it seems to work when I used this code:
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
dataGridView1.ReadOnly = true;
}
But when I get back on the menu form then go back to the form where the DataGridView
is, it can now be edit. I only define
dataGridView1.ReadOnly = true;
to this form. And I don't know whats the problem. Can someone help? Thanks.
Here's my code on the button going to the menu
Menu menu = new Menu();
this.Hide();
menu.ShowDialog();
and my button going back to the DataGrid:
FrmList frmlist = new FrmList();
frmlist.Show();
this.Hide();