Copying rows from DatagridView to Another DataGridView
Posted on 2006-11-03
I want to copy all the selected rows from a datagridview into another one. The below errors saying the row is already part of another datagrid. How do I go about this?
Private Sub DataGridView1_Mouseup(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles DataGridView1.MouseUp
DataGridView2.ColumnCount = DataGridView1.ColumnCount
For Each row As DataGridViewRow In Me.DataGridView1.SelectedRows
Thanks in advance!