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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid Serialization

Thread ID:

Created:

Updated:

Platform:

Replies:

15239 Jun 15,2004 11:09 AM UTC Jun 15,2004 01:07 PM UTC WinForms 1
loading
Tags: GridControl
Alex Nesterov
Asked On June 15, 2004 11:09 AM UTC

Hi! I have a problem with serialization of Essential Suite Grid v1.5. The Grid in my application has GridStyleInfo.CellType = "FormulaCell". So, when I try to serialize it, an exception is thrown, which says that Syncfuison.Windows.Forms.Grid.GridFormulaCellModel is not marked as serializable. I decided to apply GridStyleInfo.CellType = "TextBox" to the Grid, to serialize it and then to apply GridStyleInfo.CellType = "FormulaCell" again. I do it in the following way: private GridStyleInfo gridStyleInfo = new GridStyleInfo(); private GridBaseStyle gridBaseStyle = new GridBaseStyle(); Then in constructor after InitializeComponent() I write: this.gridBaseStyle.Name = "Standard"; this.gridStyleInfo.CellType = "FormulaCell"; this.gridBaseStyle.StyleInfo = this.gridStyleInfo; this.gridControl.BaseStylesMap.AddRange(new GridBaseStyle[] {this.gridBaseStyle}); And in the method, which serializes the Grid to a file, I write: private void Save() { this.gridStyleInfo.CellType = "TextBox"; this.gridBaseStyle.StyleInfo = this.gridStyleInfo; this.gridControl.BaseStylesMap.AddRange(new GridBaseStyle[] {this.gridBaseStyle}); this.gridControl.SaveSoap("Test.xml"); this.gridStyleInfo.CellType = "FormulaCell"; this.gridBaseStyle.StyleInfo = gridStyleInfo; this.gridControl.BaseStylesMap.AddRange(new GridBaseStyle[] {this.gridBaseStyle}); } Ok, I understand, that the styles set in the constructor and in the method Save() overlap each other, but all the same stay in memory. Can anybody help me? Thanks in advance.

Administrator [Syncfusion]
Replied On June 15, 2004 01:07 PM UTC

You might want to update to 1.6.1.8 or 2.0.x as these versions support serialization of the formula cells. I think the problem may be that just changing CellType from FormulaCell to TextBox does not do anything to the information that is stored in the style.FormulaTags. And the serialization of these objects is not supported in 1.5. So, if you wanted to do this, in addition to changing out celltypes, you would also have to make sure all teh FormulaTags were null.

CONFIRMATION

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.

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

;