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

Xml or Binary Serialization to Memory Stream

Thread ID:





72178 Mar 6,2008 02:18 PM UTC Mar 18,2008 09:41 PM UTC WinForms 1
Tags: GridControl
Chadwick Posey
Asked On March 6, 2008 02:18 PM UTC

After reading all of the samples and tinkering around with the code, I thought that since the savexml method on the grid control accepted a stream, that I could use a MemoryStream.

I have tried all the combinations I can think of to use MemoryStreams (basically serialize the grid to a string either thru xml or through encoding the binary format)... so I can save it in a column in the db.

Unfortunately, none of the methods seem to work correctly with a memory stream (but do work if you're saving to disk).

Has a) anyone ever successfully used a memorystream to persist a gridcontrol and b) could you please give me a pointer as to how to proceed?

As an aside, I have also tried using the savebinary and loadbinary methods for a cell model, but receive a "Member 'Office2007ScrollBars' was not found" exception when loading from the stream.


Administrator [Syncfusion]
Replied On March 18, 2008 09:41 PM UTC

Hi Chadwick,

Sorry for the delay in response.

If want to save in memory rather than writing to a file system, you can use SaveSoap or SaveBinary method. Please refer the below code that shows how you can save using SaveSoap or SaveBinary method.

MemoryStream s = new MemoryStream();
gridControl1.Model.SaveSoap(s); // or gridControl1.Model.SaveBinary(s);
s.Position = 0;
gridControl1.Model = GridModel.LoadSoap(s);
gridControl2.Model = GridModel.LoadSoap(s);

Please refer the sample in the below link which illustrates the above.

Thank you for your patience.

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