I want deepcopy of DataGridViewRows. I have an DataGridViewRow array generated by DataGridView.Rows.CopyTo() function. Is the array dgvra still reference to the same memory as items in DataGridView.Rows?
DGV_Comp is a DataGridView Control
DataGridViewRow[] dgvra = new DataGridViewRow[DGV_Comp.Rows.Count];
DGV_Comp.Rows.CopyTo(dgvra, 0);
From Variable watch, this is what I found
1. Both equivalent cells are 1.357
2. Chanage cell in DGV_Comp to 2.468===>Counterpart cell in dgvra also changed to 2.468
3. Chanage cell in DGV_Comp to 3.579===>Counterpart cell in dgvra also changed to 3.579
4. Clear all rows in DGV_Comp ===> Cell in dgvra changed backed to 1.357
Can anyone help to get a reasonable explanation for what I found?
Thanks in advance.