AD
Administrator
Syncfusion Team
June 25, 2003 12:16 PM UTC
Did you derive from the GridStyleInfoCustomProperties class?
If yes, then you can take advantage of built-in Xml serialization features for style objects in the 1.6 version.
If you have a GridData object, you can serialize this one as follows:
Stream s = File.OpenWrite("C:/ttt.xml");
XmlWriter xw = new XmlTextWriter(s, System.Text.Encoding.Default);
XmlSerializer xs = new System.Xml.Serialization.XmlSerializer(model.Data.GetType());
xs.Serialize(xw, model.Data);
s.Close();
To load a data object:
Stream s = File.OpenRead("C:/ttt.xml");
XmlReader xw = new XmlTextReader(s);
XmlSerializer xs = new System.Xml.Serialization.XmlSerializer(model.Data.GetType());
model.Data = (GridData) xs.Deserialize(xw);
s.Close();
You can also serialize an individual style object of course that same way (just replace the type when creating the XmlSerializer).
Stefan