Ajout de données dans un datagridview à partir d'un autre datagridview
Bonjour le forum
j'ai deux datagridview, je souhaite à chaque fois qu'une ligne est sélectionner dans 'dgvProduits', l'ajouter dans 'dgvVentesP'
Code:
1 2 3 4 5 6
| Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
dgvVentesP.Rows.Add(dgvProduits.Rows(0).Cells("IdClients").Value, dgvProduits.Rows(1).Cells("Client").Value, dgvProduits.Rows(2).Cells("Idarticle").Value, dgvProduits.Rows(3).Cells("IdRayon").Value,
dgvProduits.Rows(4).Cells("Article").Value, dgvProduits.Rows(5).Cells("Idarticlebarcode").Value, dgvProduits.Rows(6).Cells("Qte").Value)
End Sub |
lors de l'ajout, j’obtiens toujours une exception quelqu'un pourrais m'aider?