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

Serializing styleinfo only

Thread ID:





62799 Jun 22,2007 06:48 AM UTC Jun 22,2007 04:41 PM UTC WinForms 1
Tags: GridControl
Vivek Vashisht
Asked On June 22, 2007 06:48 AM UTC


I am using GridControl. I am serializing the grid by using the code

TextWriter txtWriter = new StringWriter();
XmlSerializer xs = new XmlSerializer(this.Model.Data.GetType());

xs.Serialize(txtWriter, this.Model.Data);

This code serializes the format setting (style) of the cells along with the data contained in them.
How can I just serialize the style and not the data contained in the cells?
As an example, I have a few cells which have font set to times roman + bold, have a sum formula set in one cell. Now I want to have the settings restored instead of the actual data (i.e. the font settings and the applied formula in the same cells rather than the data on which the font changes and formula were applied.)


Administrator [Syncfusion]
Replied On June 22, 2007 04:41 PM UTC

The CellValue is part of the GridStyleInfo object so it will get serialized by default. One way to avoid this is to subscribe to the GridStyleInfoStore.CellValueProperty.WriteXml event, and selectively ignore writing out the cell value at that point. Here is a sample that does this.



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