Fill DataGridView into another DatagridView

Benniit

Member
Joined
Mar 14, 2009
Messages
12
Programming Experience
Beginner
Please help me out!
Am using VB.NET 2008 and I have two DataGridviews namely DataGridview1 and DataGridView2.. Now, I have 4 columns which are check1, Name, Address and Age.
My headache now is, I want after a user checks/selects rows from DataGridView1, then those rows should be filled in DataGridView2 on a click of a button.
Is that really possible? Help me out gurus.

Thanks in advance.

ben.
 
VB.NET:
    Dim m_dtInfo As DataTable
    Dim m_dvSelected As DataView

    Private Sub Form1_Load() Handles MyBase.Load

        'Create table & dummy data
        Call CreateTableInfo()
        DataGridView1.DataSource = m_dtInfo

    End Sub

    Private Sub btnDisplayRows_Click() Handles btnDisplayRows.Click

        m_dvSelected = New DataView(m_dtInfo)
        m_dvSelected.RowFilter = "Check1 = True"
        DataGridView2.DataSource = m_dvSelected

    End Sub
 
Last edited:
Back
Top