Gridview change Row to ReadOnly

1

How can I change row of a GridView to readonly? I need to through the values of one of the cells to allow or not to edit the line of GridView .

    
asked by anonymous 14.04.2014 / 01:19

1 answer

0

From what I understand of your question, if you find a value in any of the Cells You want your line to become read only, so follow something I had in mind:

VB:

 For RCnt As Integer = 0 To DataGridView1.Rows.Count - 1
    If DataGridView1.Rows(RCnt).Cells("SpecificCell").Value = "Something" Then
    DataGridView.Rows(RCnt).ReadOnly = True
    End If
    Next

C #

for (int RCnt = 0; RCnt <= DataGridView1.Rows.Count - 1; RCnt++) 
{
    if (DataGridView1.Rows(RCnt).Cells("SpecificCell").Value == "Something") 
    {
        DataGridView.Rows(RCnt).ReadOnly = true;
    }
}
    
14.04.2014 / 19:06