I want to serilaize the Columns and rows in a grid. As grid and
columncollection from DataGridView are not serializable, the derive from the
respecitive classes and implement ISerializable interface. But I can't
implement the protected constructor for serialization for Columns as the
basde class(DataGridViewColumnCollection) doesn't have a default constructor.
What is an alternative forthis?
Marc Gravell - 09 Nov 2006 15:15 GMT
If what you are actually after is the data, then I would write custom
objects to hold them as properties, or use a DataSet, and use DataSource to
display the data in the DataGridView. Then you can serialize / deserialize
the data objects completely independently of the DataGridView, which is
(after all) a UI element an not really suited to serialization.
Marc
Ciaran O''Donnell - 09 Nov 2006 15:42 GMT
Serialise the source data and rebind the grid at the destination
Ciaran O'Donnell
> I want to serilaize the Columns and rows in a grid. As grid and
> columncollection from DataGridView are not serializable, the derive from the
> respecitive classes and implement ISerializable interface. But I can't
> implement the protected constructor for serialization for Columns as the
> basde class(DataGridViewColumnCollection) doesn't have a default constructor.
> What is an alternative forthis?