Private Sub GridWithLoop()
Dim sum As Integer = 0
Dim sum2 As Integer = 0
Dim allrow As DataGridViewRow
Dim band As DataGridViewBand
For i As Integer = 0 To DataGridView2.Rows.Count() - 1 Step +1
'sum = sum + DataGridView2.Rows(i).Cells(1).Value'
allrow = DataGridView2.Rows(i)
If allrow.Cells(1).Value.ToString = TextBox1.Text Then
'Nothing happen'
Else
band = DataGridView2.Rows(i)
band.Visible = False
End If
Next
End Sub
I am not able to make it work, it gives error when I try to put row as invisible, can someone help me?