First, copy the schema of the table you want to copy, to the new table
Dim dtTable As DataTable
Dim dtTableNew As DataTable
Dim oDataRow As DataRow
dtTableNew = dtTable.Clone
oDataRow = dtTable.Rows(
Me.dgAssignIOPayments.DataSource = dtTableNew
For this case, I wanted the user to select a row, copy that to a holding area, where the user will then
select from another data grid to merge data entries in a controlled environment.
dim newTable as new dataTable
after that, using ImportRow you can copy the rows you want
For n As Integer = 0 To originalTable.Rows.Count – 1
if you were to use the newTable.AddRow, you might just get the following error:
Rows cannot be programmatically added to the DataGridView’s rows collection when the control is data-bound.