Hello all
I want to know is it possible to save and restore the grid's state in any way.
Any way means with any method.
Thanks
Printable View
Hello all
I want to know is it possible to save and restore the grid's state in any way.
Any way means with any method.
Thanks
According to me, You have to use binary data serialization method to save and restore the grid's state.You can get detailed explanation of this on http://www.******.com/en/net-suite/n...-serialization
a litle part of code is here
//The method serializes the grid's state into the XML file
void XmlSerialization(Grid grid, string fileName)
{
using(FileStream fs = new FileStream(fileName, FileMode.OpenOrCreate, FileAccess.Write))
{
XmlSerializer serializer = new XmlSerializer(typeof(Grid.GridSerializationState));
serializer.Serialize(fs, grid.SerializationState);
}
}
//The method deserializes the grid's state from the XML file
void XmlDeserialization(Grid grid, string fileName)
{
using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read))
{
XmlSerializer serializer = new XmlSerializer(typeof(Grid.GridSerializationState));
grid.SerializationState = (Grid.GridSerializationState) serializer.Deserialize(fs);
}
}