loadSoap - without the data

I am using a standard grid control. And would like to use savesoap/loadsoap to remember the column orders and widths, but not the data that was in the grid.

Is that possible?

Mark C

3 Replies

AD Administrator Syncfusion Team February 8, 2007 11:28 PM UTC

Hi Mark,

If this is a GridControl, then you can use GridModel.LoadBinary and this.grid.Model.SaveBinary (or LoadSoap & SaveSoap) to serialize your grids.

You can use this code snippet to load the layout information to grid.

this.grid.Model= GridModel.LoadSoap("layoutinfo.grd");

If these are GridDataBoundGrids, then we currently don't support direct serialization of this grid. Right now, you would have to do things yourself. Here is a forum tread that has a sample that serializes out column order and size.
http://www.syncfusion.com/forums/message.asp?MessageID=3918

Here is a sample that shows how you can serialize Datasource(custom collection).
http://www.syncfusion.com/Support/user/uploads/ISerializeSample_42c2a964.zip

Best regards,
Haneef


AD Administrator Syncfusion Team February 9, 2007 01:47 AM UTC

It's a gridControl, and that is exactly what I'm doing. But the 20 rows of data are also saved and loaded. I want to load the grid layout, and then fill it with new data.

Mark C


AD Administrator Syncfusion Team February 9, 2007 10:42 PM UTC

Hi Mark,

There is no built-in way of doing this. The two methods for saving/restoring GridControl state (LoadBinary/SaveBinary and LoadSoap/SaveSoap) automatically save the values as part of the GridStyleInfo objects. You could write your own routines to save explicitly the items you want to persist (it would be straight forward as the persistence is really handled by the .NET Framework methods.) . Here is a sample http://www.syncfusion.com/support/user/uploads/savegrid.zip that will save the order and size of columns in a GridDataBoundGrid. You could add additional information in the same manner. You could also use a SoapFormatter instead of the binary one. Or, you could just save an XML file directly.

Best regards,
Haneef

Loader.
Up arrow icon