Custom Serialization and DataGridView

G

Guest

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?
 
M

Marc Gravell

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
 
G

Guest

Serialise the source data and rebind the grid at the destination

Ciaran O'Donnell
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top