Editing cells in datagridview
Hi all!
I would like to ask you something related a problem which occurs in my app.
There is a datagrid view, which I add and delete some rows.
All the rows must be "ReadOnly" rows, except the first one. The user of application must be able to edit the first row of the datagrid using the keyboard in order to type the data.
I try this code in order to have this behavior:
Code:
this.m_snapshotDatagrid.Rows.Clear();
this.m_snapshotDatagrid.Rows.Add();
this.m_snapshotDatagrid.Rows[0].ReadOnly = false;
But, when I try to edit the row, I am not able to edit any cell of the first line of the datagrid.
Does someone could help me to solve this problem?
Thank you in advance!
Gustavo
Re: Editing cells in datagridview
Quote:
Originally Posted by
gborges
Hi all!
I would like to ask you something related a problem which occurs in my app.
There is a datagrid view, which I add and delete some rows.
All the rows must be "ReadOnly" rows, except the first one. The user of application must be able to edit the first row of the datagrid using the keyboard in order to type the data.
I try this code in order to have this behavior:
Code:
this.m_snapshotDatagrid.Rows.Clear();
this.m_snapshotDatagrid.Rows.Add();
this.m_snapshotDatagrid.Rows[0].ReadOnly = false;
But, when I try to edit the row, I am not able to edit any cell of the first line of the datagrid.
Does someone could help me to solve this problem?
Thank you in advance!
Gustavo
First of all, make sure if DataGridView.ReadOnly = false. Then check all columns you want to eidt are readonly or not. If the column is readonly, you can't edit the related cell even the row is not readonly.