Articles in this section
Category / Section

How to save the content of a Grid to memory rather than in a file system and export to another grid in WinForms GridControl?

2 mins read

Save the content in memory

You can save the contents of a grid in the memory, rather than writing it to a file system by using the SaveSoap or SaveBinary methods to export the WinForms GridControl. The following code examples explain how to save the Grid content by using the SaveSoap or SaveBinary methods.

C#

MemoryStream s = new MemoryStream();
// Using SaveSoap Method.
gridControl1.Model.SaveSoap(s);
//Set data position to the starting point to load.
s.Position = 0;
gridControl2.Model = GridModel.LoadSoap(s);
//Using SaveBinary Method.
gridControl1.Model.SaveBinary(s);
//Set data position to the starting point to load.
s.Position = 0;
gridControl2.Model = GridModel.LoadBinary(s);

VB

Dim s As New MemoryStream()
'Using SaveSoap Method.
gridControl1.Model.SaveSoap(s)
'Set data position to the starting point to load.
s.Position = 0
gridControl2.Model = GridModel.LoadSoap(s)
'Using SaveBinary Method.
gridControl1.Model.SaveBinary(s)
'Set data position to the starting point to load.
s.Position = 0
gridControl2.Model = GridModel.LoadBinary(s)

Samples:

C#: SaveGridContentInMemory

VB: SaveGridContentInMemory

Conclusion

I hope you enjoyed learning about how to save the content of a Grid to memory rather than in a file system and export to another grid in WinForms GridControl.

You can refer to our WinForms GridControl’s feature tour page to know about its other groundbreaking feature representations. You can also explore our WinForms GridControl documentation to understand how to present and manipulate data.

For current customers, you can check out our WinForms components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our WinForms GridControl and other WinForms components.

If you have any queries or require clarifications, please let us know in comments below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied