Custom Serialization and DataGridView

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ManjuG

    Custom Serialization and DataGridView

    I want to serilaize the Columns and rows in a grid. As grid and
    columncollectio n 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(DataGridV iewColumnCollec tion) doesn't have a default constructor.
    What is an alternative forthis?
  • Marc Gravell

    #2
    Re: Custom Serialization and DataGridView

    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


    Comment

    • Ciaran O''Donnell

      #3
      RE: Custom Serialization and DataGridView

      Serialise the source data and rebind the grid at the destination

      Ciaran O'Donnell

      "ManjuG" wrote:
      I want to serilaize the Columns and rows in a grid. As grid and
      columncollectio n 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(DataGridV iewColumnCollec tion) doesn't have a default constructor.
      What is an alternative forthis?

      Comment

      Working...