i find this code :
private void button1_Click(object sender, EventArgs e)
{
foreach (DataGridViewRow row in this.table1DataGridView.SelectedRows)
{
object[] rowData = new object[row.Cells.Count];
for (int i = 0; i < rowData.Length; ++i)
{
rowData[i] = row.Cells[i].Value;
}
this.copyDataGridView.Rows.Add(rowData);
}
}
but it throw an exception:
Additional information: Rows cannot be programmatically added to the DataGridView's rows collection when the control is data-bound.
is the code correct??what should i do?