We store and load the schema of a groupinggridControl in a XML, as mentioned in your samples (XML Serialization Demo):
FileDialog dlg = new OpenFileDialog();
dlg.Filter = "xml files (*.xml)|*.xml|All files (*.*)|*.*" ;
if (dlg.ShowDialog() == DialogResult.OK)
{
XmlReader xr = new XmlTextReader(dlg.FileName);
GridEngine engine = GridEngine.CreateFromXml(xr);
if (engine != null)
this.gridGroupingControl1.Engine.InitializeFrom(engine);
xr.Close();
}
The problem: in Designer we setup the theme to "Office2007", but when the gridengine gets the xmlschema, it shows the layout of SystemTheme. It can be reproduced by simply deleting the xmlfile, then it is loaded correctly with "Office2007"
Any hint?
Have a nice weekend
Hi Sascha,
Thank
you for contacting Syncfusion Forums
You
could resolve this issue by serializing the Grid’s look and feel too. The below
codes are an example to serialize the Grid with its look and feel into xml.
XmlTextWriter xw = new XmlTextWriter("GridSchema.xml",
System.Text.Encoding.UTF8);
XmlTextWriter
xwApp = new XmlTextWriter("GridLooknFeel.xml", System.Text.Encoding.UTF8);
xw.Formatting = System.Xml.Formatting.Indented;
this.gridGroupingControl1.WriteXmlSchema(xw);
this.gridGroupingControl1.WriteXmlLookAndFeel(xwApp);
xw.Close();
xwApp.Close();
XmlReader xr = new XmlTextReader("GridSchema.xml");
XmlReader
xrApp = new XmlTextReader("GridLooknFeel.xml");
this.gridGroupingControl1.ApplyXmlSchema(xr);
this.gridGroupingControl1.ApplyXmlLookAndFeel(xrApp);
xr.Close();
scd.Format = "{Average:#}";
xrApp.Close();
Here is
the sample for you reference.
http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=Xml1374841421.zip
Please
let us know if you have any concerns
Regards,
Kalai
Yeap, that works. Thank you.