title: Remove row in datagridview with for each messes up index so it skips rows
body: <p>I'm currently changing my project from a listview over to a datagridview, and ran into another "problem" when I try to remove rows that starts with x string.</p>
  
  <pre><code>For Each itm As DataGridViewRow In DataGridView1.Rows
  If Not itm.Cells(0).Value.StartsWith(myValue) Then
      DataGridView1.Rows.Remove(itm)
  End If
  Next
  </code></pre>
  
  <p>So yeah, I have come to the conclusion that it messes up the index or foreach somehow, because after it removes a row, it skips the next row that took the others index/place, if that makes sense..</p>