Hi Jan,
Thank you for your interest in Syncfusion products.
You can serialize the GridModel directly to binary format using the SaveBinary() and so you can use the following way to achieve the desired behavior instead of serializing using BinaryFormatter and Stream.
// Serialize
if (dr ==
System.Windows.Forms.DialogResult.OK)
{
dataStructure.Textbox1Text =
textBox1.Text;
dataStructure.Textbox2Text =
textBox2.Text;
this.gridControl1.Model.SaveBinary(saveFileDlg.FileName);
}
//Deserialize
if (dr ==
System.Windows.Forms.DialogResult.OK)
{
this.gridControl1.Model
= GridModel.LoadBinary(openFileDlg.FileName);
this.gridControl1.Refresh();
textBox1.Text =
dataStructure.Textbox1Text;
textBox2.Text =
dataStructure.Textbox2Text;
}
Sample for your reference
http://www.syncfusion.com/downloads/Support/DirectTrac/96689/Example-349884176.zip
Please let us know if you have any concerns
Regards,
Kalai