de dgv a dgv
Publicado por chan (8 intervenciones) el 29/05/2007 00:38:03
hola que tal saludos a todos, espero me puedan ayudar
tengo dos datagridview y necesito pasar datos de una a a otra, y me marca un error, este No se pueden agregar filas mediante programación a la colección de filas de DataGridView cuando el control está enlazado a datos.
no entiendo por que espero me puedan ayudar, este el el pedazo de código:
Me.dgvsacar.Rows.Add()
Me.dgvsacar.Item(0, indice).Value = Me.dgvref.Rows(Me.dgvref.CurrentRow.Index).Cells(0).Value.ToString
Me.dgvsacar.Item(1, indice).Value = Me.dgvref.Rows(Me.dgvref.CurrentRow.Index).Cells(1).Value.ToString
Me.dgvsacar.Item(2, indice).Value = Me.Txtcantidad.Text
Me.dgvsacar.Item(3, indice).Value = Me.dgvref.Rows(Me.dgvref.CurrentRow.Index).Cells(8).Value.ToString
Me.dgvsacar.Item(4, indice).Value = Me.dgvref.Rows(Me.dgvref.CurrentRow.Index).Cells(9).Value.ToString
indice += 1
de antemano muchas gracias
tengo dos datagridview y necesito pasar datos de una a a otra, y me marca un error, este No se pueden agregar filas mediante programación a la colección de filas de DataGridView cuando el control está enlazado a datos.
no entiendo por que espero me puedan ayudar, este el el pedazo de código:
Me.dgvsacar.Rows.Add()
Me.dgvsacar.Item(0, indice).Value = Me.dgvref.Rows(Me.dgvref.CurrentRow.Index).Cells(0).Value.ToString
Me.dgvsacar.Item(1, indice).Value = Me.dgvref.Rows(Me.dgvref.CurrentRow.Index).Cells(1).Value.ToString
Me.dgvsacar.Item(2, indice).Value = Me.Txtcantidad.Text
Me.dgvsacar.Item(3, indice).Value = Me.dgvref.Rows(Me.dgvref.CurrentRow.Index).Cells(8).Value.ToString
Me.dgvsacar.Item(4, indice).Value = Me.dgvref.Rows(Me.dgvref.CurrentRow.Index).Cells(9).Value.ToString
indice += 1
de antemano muchas gracias
Valora esta pregunta


0