Form3 f3 = new Form3();
int RC=dataGridView2.RowCount;
for (int j = 0; j < RC; j++)
{
for (int i = 0; i < 3; i++)
{
f3.dataGridView1.Rows.Add();
f3.dataGridView1.Rows[j].Cells[i].Value = dataGridView2.Rows[j].Cells[i].Value;
}
}
f3.Show();
this.Hide();
}
foreach (DataGridViewRow row in dataGridView1.SelectedRows)
{
object[] items = new object[row.Cells.Count];
for (int i = 0; i < row.Cells.Count; i++)
{
items[i] = row.Cells[i].Value;
}
dataGridView2.Rows.Add(items);
// fromDGV.Rows.Delete(row);
}