Click here to Skip to main content
15,910,471 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have some rows in datagridview.
How can i disable/enabled the specified row in datagridview???

Please any help me......
Thanks
Posted

1 solution

There's no way to disable an specific row using the datagridview object.

But there was another options, like changing the format of the row you want in order to make this seems like disabled:
VB.NET
Private Sub ConfigDisabled(Byval RowNumber as integer)
Dim CelaActiva As New DataGridViewCellStyle
CelaActiva.BackColor = Color.White
CelaActiva.Alignment = DataGridViewContentAlignment.MiddleCenter
CelaActiva.SelectionBackColor = Color.White
CelaActiva.SelectionForeColor = Color.Gray
CelaActiva.ForeColor = Color.Gray

Datagridview1.Rows(RowNumber).DefaultCellStyle = CelaActiva
Datagridview1.Rows(RowNumber).ReadOnly = True
End Sub


Hope this helps you ;)
 
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