title: How to filter datagridview by string in textbox in visual basic without using SQL query WHERE?
body: <p>I'm trying to filter rows of datagridview based on textBox value. I want to remove all rows which don't have values like in column NAZIV. I'm new in visual basic. </p>
  
  <p>Name of datagridView is dvgIQ </p>
  
  <p>I've tried this but it's not working.</p>
  
  <pre><code>    Sub filter
        If textBox1.Text.Length&gt;=3 Then
          For i As Integer = dvgIQ.Count-1  To 0 Step -1
            If Not dvgIQ.Rows(i).Cells(4).Value.ToString(textBox1.Text.ToLower) Then
              dvgIQ.Rows.RemoveAt(i)
            End If
          Next i
        Else If textBox1.Text.Length&gt;0 And textBox1.Text.Length&lt;3 Then
              MsgBox("warning")
        End If
      End Sub
  </code></pre>
  
  <p>Thanks in advance</p>