Copiar fila seleccionada de DataGridView1 a DataGridView2
Necesito copiar la fila seleccionada de DataGridView1 a DataGridView2 y luego eliminarla de DataGridView1. Adjunto el código desarrollado que está mal porqué me copia siempre la primera fila activa. Gracias por su apoyo.
Private Sub TextBox2_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TextBox2.KeyPress For i As Integer = 0 To DataGridView1.Rows.Count - 2 For x As Integer = 0 To DataGridView1.ColumnCount - 1 If DataGridView1.Rows(i).Cells(x).Value.ToString.Contains(TextBox2.Text) Then DataGridView1.Rows(i).Selected = True Dim Col1 As String = DataGridView1.Rows(i).Cells(0).Value Dim Col2 As String = DataGridView1.Rows(i).Cells(1).Value Dim Col3 As String = DataGridView1.Rows(i).Cells(2).Value Dim Col4 As String = DataGridView1.Rows(i).Cells(3).Value DataGridView2.Rows.Add(Col1, Col2, Col3, Col4) For Each r As DataGridViewRow In DataGridView1.SelectedRows DataGridView1.Rows.Remove(r) Next DataGridView1.ClearSelection() Exit Sub End If Next x Next i MsgBox("Error de Picking") TextBox2.Text = "" End Sub