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.
Unfortunately, activation email could not send to your email. Please try again.

Serializing styleinfo only

Thread ID:

Created:

Updated:

Platform:

Replies:

62799 Jun 22,2007 02:48 AM Jun 22,2007 12:41 PM Windows Forms 1
loading
Tags: GridControl
Vivek Vashisht
Asked On June 22, 2007 02:48 AM

Hi,

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.)

thanks
vivek

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

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.


35063.zip

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.

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.

;