Objective Grid : PART II Programmer’s Guide : Chapter 22 Grid XML Serialization Architecture : Usage Example
Usage Example
To start using this feature in your Objective Grid applications, you have to modify your document class to make it derive from SECXMLDocAdapter_T and override the XMLSerialize() virtual. From inside the overridden XMLSerialize() virtual you can simply use the pre-built formatters to serialize all or some of the Objective Grid data components. For example, to serialize the whole grid, the override will look like this:
 
void CGridSampleDoc::XMLSerialize(SECXMLArchive& ar)
{
if(ar.IsStoring())
{
CGXGridParam* pParam = (CGXGridParam*)GetParamInYourDocument();
ar.Write(NULL, CGXGridParamFTR(pParam));
}
else
{
CGXGridParam* pParam = NULL;
ar.Read(NULL, CGXGridParamFTR(pParam));
BindParamToYourGrid(pParam);
}
}