I need to copy a DGV from a bounded DGV to a normal DGV.
Reason: I need to add combobox-columns after load from Dataset and thats not possible on bound-DGV. So I tried to copy the content in new DGV. Any better ideas??
I used this to copy the dgv: copy Datagrids
Then i wrote this to test it with a button:
private void button1_Click(object sender, EventArgs e)
{
dgvExcel2.AutoGenerateColumns = true;
dgvExcel2 = CopyDataGridView(dgvExcel);
dgvExcel2.Refresh();
dgvExcel2.Show();
dgvExcel2.Update();
}
(Update, Show, Refresh just to try something because it doesn' work)
When I run the program on UI the dgvExcel2 is always empty. But when i debug i see that there is content in data.