Ver Mensaje Individual
  #20 (permalink)  
Antiguo 12/01/2011, 11:25
Erick21
 
Fecha de Ingreso: abril-2010
Ubicación: Lima-Peru
Mensajes: 96
Antigüedad: 14 años
Puntos: 2
Respuesta: Pasar Fila de un Datagrid a Otro

Hola gracias por ayudarme , al final lo logre hacer pero cambie el datagrid a
datagridview y lo enlace a un datatable para trabajarlo de la misma manera.

Private Sub btneliminar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btneliminar.Click
Try
If dtb.Rows.Count = 0 Then
MessageBox.Show("Seleccione una Fila ", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1)
Else
Remover()
End If
Catch ex As Exception
Throw ex
End Try
End Sub
Sub Remover()
For Each Seleccion As DataGridViewRow In dgvlista.SelectedRows
dtb2.Rows.Add(Valores(Seleccion))
dgvlista.Rows.Remove(Seleccion)
Next

End Sub
Function Valores(ByVal fila As DataGridViewRow) As String()
Dim contenido(dgvlista.ColumnCount - 1) As String
For x As Integer = 0 To contenido.Length - 1
contenido(x) = fila.Cells(x).Value
Next
Return contenido
End Function

gracias nuevamente por tu tiempo , seguire investigando y aprendiendo mas.