Clone (deep copy) datagrid
-
Hi guys, I just spent about 4 hours of searching for how to make a deep copy of a datagrid. I tried to serialize it, but its marked as being unserializable. I also read about manual cloning (like implementing the ICloneable interface) but didn't get the clue. So theres a third option I already read of: Creating a new class, which inherits the datagrid and provides a new method (named deepcopy() or whatever), whichs task ist to create a new instance of a datagrid and transfers all the properties/variables/objects of the sourcedatagrid and finally returns the new instance. since the datagrid isn't a small class, it would take a long time to write this method. since you could use this method for datagrids only, it would be very inefficient. So here's the question: Is there any possibility to write a clone-function which creates a deep copy and works for every kind of object? thanks in advance, mik :) *edit* i also read something about reflection but the english was too difficulty to read, so i didn't get the point :/ if that could be a solution i would be pleased about any links to a nice explanation :) -- modified at 6:08 Thursday 8th September, 2005