Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi ,

Can any one please help how to do this.

I have the requirement to make the selected DataGridView Row ReadOnly Property To false.

I have tried the following code:

dataGridView1.Rows[1].Cells[0].ReadOnly = false;

The Problem is the ReadOnly Property of the Complete Column[0](0th Column) is changing to false .

Please help me how to proceed further.

Thanks in Advance,

Regards,

Aditya Kiran M.
Posted
Updated 16-Apr-11 0:34am
v4
Comments
Sandeep Mewara 15-Apr-11 9:03am    
The Problem is the ReadOnly Property of the Complete Column[0] is changing to false .
Typo?
aditya kiran maroju 15-Apr-11 9:26am    
Hi it is Zeroth Column. The complete zeroth column read only property is going to false.
Oshtri Deka 15-Apr-11 11:07am    
If dataGridWiev is set to readOnly by default, why do you want to change it?

Try:
DataGridViewRow r = dataGridView1.SelectedRows[0];
if (r != null)
    {
    r.ReadOnly = false;
    }
 
Share this answer
 
Comments
aditya kiran maroju 15-Apr-11 10:42am    
Hi i have tried the above way. The same Problem arises
OriginalGriff 15-Apr-11 15:04pm    
Try again: this worked when I tried it on a new form. Do you have anythi9g else which might be affecting it?
aditya kiran maroju 16-Apr-11 6:29am    
Thank you it worked .. i have made it in a new form and could resolve the problem.
shaikh-adil 2-Jan-13 2:49am    
+5
if you want the row ReadOnly property to be false then use this

dataGridView1.CurrentRow.ReadOnly = false;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900