martes, 6 de marzo de 2012

Agregar filas nuevas con código

 Dim i As Integer
        If DataTable1DataGridView.Rows.Count > 0 Then
            For i = 0 To DataTable1DataGridView.Rows.Count - 2
                Dim nuevafila As DataRow = SuperDataSet.Tables("DetallesPedido").NewRow
                nuevafila.Item("IdPedido") = DataTable1DataGridView.Rows(i).Cells(0).Value
                nuevafila.Item("IdProducto") = DataTable1DataGridView.Rows(i).Cells(1).Value
                nuevafila.Item("Cantidad") = DataTable1DataGridView.Rows(i).Cells(3).Value

                SuperDataSet.Tables("DetallesPedido").Rows.Add(nuevafila)
            Next

        End If

No hay comentarios:

Publicar un comentario