Click here to Skip to main content
15,877,376 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
I want datagrid rows in disabled state when edit event is called.I cant disable the datagrid at that time as i need scrollbar also..So please help me

Dear Friend,

You can not disable a datagridview row. The only thing you can do is make it readonly.

Private Sub Button8_Click(ByVal sender As Object, _
    ByVal e As System.EventArgs) Handles Button8.Click

    For Each band As DataGridViewBand In dataGridView.Columns
        band.ReadOnly = True
End Sub

In edit mode add this line:-

DataGridView1.ReadOnly = True[^]

try this:-[^]

Please try these link:- To make any column readonly in Datagrid[^][^][^]

I hope this will help you out.
Share this answer
sofia3 18-Feb-12 5:29am    
Its not effect on it:(
Varun Sareen 18-Feb-12 5:56am    
have you tried the link? and plese sofia don't repost the same question, ask what ever you want to ask here only in this question only. OK?
sofia3 18-Feb-12 6:18am    
This is also not working..Kindly hv a look
sofia3 18-Feb-12 6:12am    
Dear varun its not working..i hv tried this also..Please suggest some more
sofia3 18-Feb-12 6:13am    
default property of datagrid readonly is false

try this..


do the same for how many columns you have...
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