here is my code , but it is not working
Code:
Private Sub Txt_Search_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Txt_Search.TextChanged
Dim SearchStr As String = Me.Txt_Search.Text
If SearchStr = "" Then
Exit Sub
Else
SearchStr = String.Concat("%", SearchStr)
End If
Dim Sx = From Dr As DataGridViewRow In Me.DataGridView1.Rows _
Where Dr.Cells(0).Value Like SearchStr _
Select Dr.Index
If Sx.Count <= 0 Then
Exit Sub
End If
With Me.DataGridView1
.Rows(Sx.ToList(0)).Selected = True
.CurrentCell = .Rows(Sx.ToList(0)).Cells(0)
End With