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.

strange serialization problem in 4.1. Beta with .NET 2.0

Thread ID:

Created:

Updated:

Platform:

Replies:

38732 Dec 16,2005 10:42 AM Dec 16,2005 07:56 PM Windows Forms 1
loading
Tags: GridControl
Uwe Wittig
Asked On December 16, 2005 10:42 AM

Hello, serialization and the following deserialization of GridStyleInfoStore Type gives me an error. The code worked in Syncfusion 3.3 and .NET 1.1 private string SerializeObject(ISerializable objectToSerialize) { MemoryStream memStream = new MemoryStream(1000); XmlSerializer ser2 = new XmlSerializer(objectToSerialize.GetType()); ser2.Serialize(memStream, objectToSerialize); System.Text.Encoding encoder = System.Text.Encoding.GetEncoding("windows-1252"); return encoder.GetString(memStream.GetBuffer()); } private void DeserializeObjectFromString(Type typeToDeserialize, ref ISerializable objectToDeserialize, string data) { try { System.Text.Encoding encoder = System.Text.Encoding.GetEncoding("windows-1252"); MemoryStream memStream = new MemoryStream(encoder.GetBytes(data)); XmlSerializer serializer = new XmlSerializer(typeToDeserialize); objectToDeserialize = (ISerializable)serializer.Deserialize(memStream); } catch (Exception ex) { textBox2.Text = ex.ToString(); } } GridStyleInfo info = new GridStyleInfo(); info.CellValueType = typeof(string); info.Format = "G"; textBox1.Text = SerializeObject(info.Store); textBox2.Text = ""; try { ISerializable store = null; DeserializeObjectFromString(typeof(Syncfusion.Windows.Forms.Grid.GridStyleInfoStore), ref store, textBox1.Text); } catch (Exception ex) { textBox2.Text = ex.ToString(); } The XML is: "G" It has to do with CellValueType, if I remove it there is no problem, also if I change it to there is no error. Thanks, Uwe

DeserializeObject0.zip

Administrator [Syncfusion]
Replied On December 16, 2005 07:56 PM

Hello Uwe, thanks for reporting this. It will be fixed in the final realease. The CellValueType was simply not written out to the xml. Thanks, Stefan >Hello, > >serialization and the following deserialization of GridStyleInfoStore Type gives me an error. The code worked in Syncfusion 3.3 and .NET 1.1 > > private string SerializeObject(ISerializable objectToSerialize) > { > MemoryStream memStream = new MemoryStream(1000); > XmlSerializer ser2 = new XmlSerializer(objectToSerialize.GetType()); > ser2.Serialize(memStream, objectToSerialize); > > System.Text.Encoding encoder = System.Text.Encoding.GetEncoding("windows-1252"); > return encoder.GetString(memStream.GetBuffer()); > } > > private void DeserializeObjectFromString(Type typeToDeserialize, ref ISerializable objectToDeserialize, string data) > { > try > { > System.Text.Encoding encoder = System.Text.Encoding.GetEncoding("windows-1252"); > MemoryStream memStream = new MemoryStream(encoder.GetBytes(data)); > > > XmlSerializer serializer = new XmlSerializer(typeToDeserialize); > objectToDeserialize = (ISerializable)serializer.Deserialize(memStream); > } > catch (Exception ex) > { > textBox2.Text = ex.ToString(); > } > } > > GridStyleInfo info = new GridStyleInfo(); > info.CellValueType = typeof(string); > info.Format = "G"; > > textBox1.Text = SerializeObject(info.Store); > > textBox2.Text = ""; > try > { > ISerializable store = null; > DeserializeObjectFromString(typeof(Syncfusion.Windows.Forms.Grid.GridStyleInfoStore), ref store, textBox1.Text); > } > catch (Exception ex) > { > textBox2.Text = ex.ToString(); > } > >The XML is: > > > > "G" > > >It has to do with CellValueType, if I remove it there is no problem, also if I change it to > there is no error. > >Thanks, >Uwe > > >

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

;