please I want to send records in datagridbiew 1 to another datagridview2
is like if a user click on a button it Shud be able to send maybe 5 records in datagridview1 to datagridview2 at the Same time
please I need your help.

You could use a module to send data to both datagridviews

Hello prince,

Please provide your code and highlight where you are facing problem or what error you are getting. please be specific.

Hi Prince,

If I understand you correctly maybe this link can help you:

or using this sample code:

Public Class Form1

Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
End Sub

Dim tableOfDgv1, tableOfDgv2
Private Sub initializeDgv1()
    tableOfDgv1 = New DataTable()
    dataGridView1.DataSource = tableOfDgv1
End Sub

Private Sub initializeDgv2()
    tableOfDgv2 = New DataTable()
    dataGridView2.DataSource = tableOfDgv2
End Sub

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
    Dim table1Value As DataRow
    For i As Integer = 0 To DataGridView1.Rows.Count - 2
        table1Value = tableOfDgv2.NewRow()
        table1Value("Dgv2_Column1") = DataGridView1.Rows(i).Cells("Dgv1_Column1").Value.ToString()
        table1Value("Dgv2_Column2") = DataGridView1.Rows(i).Cells("Dgv1_Column2").Value.ToString()
    DataGridView2.DataSource = tableOfDgv2
End Sub

End Class

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.