I have an arraylist that is holding gridlist controls. E.g.:
Dim dt_StudbookID As New DataTable
Dim dr_DRow As DataRow
Dim dc_DCol As DataColumn
Dim dg_DataGrid As New Syncfusion.Windows.Forms.Grid.GridControl
Dim str_X As String = ""
dg_DataGrid.RowCount = 0
dg_DataGrid.ColCount = 2
dg_DataGrid(0, 0).Text = "Adrian Lin"
dg_DataGrid(0, 1).Text = "1/10/2004"
dg_DataGrid(0, 2).Text = "Extraction"
Which works fine but when I attempt to save the arraylist binary wise:
Dim bf_AList As Formatters.Binary.BinaryFormatter
Dim fstream_AList As IO.FileStream
Dim str_FileNamePathX As String = ""
str_FileNamePathX = "C:\Documents and Settings\alin\My Documents\Visual Studio Projects\ZooRisk0.9NGUI\bin\ZRISKFS\Projects\Single Species\Copy of pygmy hippo 7\Scenarios\Baseline\Genetic Storage\IGMATRIXLINEAR"
bf_AList = New Formatters.Binary.BinaryFormatter
fstream_AList = New IO.FileStream(str_FileNamePathX, FileMode.OpenOrCreate, FileAccess.Write)
bf_AList = Nothing
fstream_AList = Nothing
this is what i get:
An unhandled exception of type ''System.Runtime.Serialization.SerializationException'' occurred in mscorlib.dll
Additional information: The type Syncfusion.Windows.Forms.Grid.GridControl in Assembly Syncfusion.Grid.Windows, Version=184.108.40.206, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89 is not marked as serializable.
I find this confusing since if you do GridControl1.Model.SaveBinary you can save a gridcontol binary.
Any help would be great. Thanks,
ADAdministrator Syncfusion Team January 27, 2005 02:21 PM UTC
Do not serialize your arraylist of GridControls. Instead, serialize an arraylist of gridControl.Model objects.
It is GridModel that is serializable, not GridControl. When reading things back in, take the arraylist of GridModels, and create GridControls using the GridControl constructor that accepts a GridModel.
ALAdrian LinJanuary 27, 2005 02:28 PM UTC
I see. I''ll give it a shot. Thanks.
>Do not serialize your arraylist of GridControls. Instead, serialize an arraylist of gridControl.Model objects.
>It is GridModel that is serializable, not GridControl. When reading things back in, take the arraylist of GridModels, and create GridControls using the GridControl constructor that accepts a GridModel.