private void Form1_Load(object sender, EventArgs e)
{
foreach(DataGridViewColumn c1 in dataGridView1.Columns)
{
DataGridViewColumn c2 = (DataGridViewColumn)c1.Clone();
dataGridView2.Columns.Add(c2);
}
}
private void dataGridView1_CellContentClick(object sender,
DataGridViewCellEventArgs e)
{
DataGridViewRow r2 =
(DataGridViewRow)dataGridView2.Rows[0].Clone();
int i=0;
foreach( DataGridViewCell cell in
dataGridView1.Rows[e.RowIndex].Cells)
{
r2.Cells.Value = cell.Value;
i++;
}
dataGridView2.Rows.Add(r2);
dataGridView2.Refresh();
}
try thsi one first oin pageload add columns from first too secord datagrid
and then
in CellContentClick event add row from first to secord datagridview.