We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Deserialization loses scroll bars

Thread ID:





47882 Aug 15,2006 09:31 PM UTC Aug 16,2006 04:39 AM UTC WinForms 1
Tags: GridControl
John Dumais
Asked On August 15, 2006 09:31 PM UTC


I''m trying to figure out a problem I''ve run into using a GridControl. I use the SetRowHidden method to expand/collapse some the rows in the grid. When the grid expands and contracts, it creates or removes a vertical scroll bar as necessary. That''s good. Trouble is, when I serialize the grid, then deserialize it, the newly-deserialized grid instance loses the vertical scroll bar. To get the scroll bar to update, I need to collapse all the grid rows under one main row, then expaned things out again. I was wondering how to serialize/deserialize the grid and keep the scroll bars updated correctly? Here''s how I serialize/deserialize...

private void saveButton_Click(object sender, System.EventArgs e)
Stream stream;
SaveFileDialog saveFileDialog1 = new SaveFileDialog();

saveFileDialog1.Filter = string.Format("{0} files (*.xml)|*.xml", EnvironmentSetup.GetSTWAppName());
saveFileDialog1.FilterIndex = 0 ;
saveFileDialog1.RestoreDirectory = true ;
saveFileDialog1.InitialDirectory = controller.ProjectDirectory;

if(saveFileDialog1.ShowDialog() == DialogResult.OK)
if((stream = saveFileDialog1.OpenFile()) != null)
this.Cursor = Cursors.WaitCursor;
this.saveButton.Enabled = false;

StreamWriter sw = new StreamWriter(stream);
IFormatter formatter = new SoapFormatter();
formatter.Serialize(stream, gridControl1.Model);
this.saveButton.Enabled = true;
this.Cursor = Cursors.Default;

IFormatter formatter = new SoapFormatter();
gridControl1.Model = (GridModel)formatter.Deserialize(stream);



Administrator [Syncfusion]
Replied On August 16, 2006 04:39 AM UTC

Hi John,

After the deserialize the grid, you can call the ResetVolatileData and Refresh method to refresh the grid.


Suggestion :

There is a built-in method for serializing/de-serializing the Grid. You can use the SaveSoap method to serialize the GridModel and use the LoadSoap method to de-serialize the GridModel. Please find the code snippet below.


//Static method in GridModel Class.

Best Regards,


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon