How to save the content of a Grid to memory rather than in a file system and export to another grid in WinForms GridControl?
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.
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);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:
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 feature tour page to know about
its other groundbreaking feature representations and WinForms GridControl documentation, and how
to quickly get started for configuration specifications.
For current
customers, you can check out our 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 other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!