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. Image for the cookie policy date
close icon

GGC Loading schema falls back to SystemTheme

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

 

 


3 Replies

KB Kalaiarasan B Syncfusion Team July 30, 2012 04:50 AM UTC

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



MS Mr. Sascha Wald July 30, 2012 06:23 AM UTC

Yeap, that works. Thank you.



KB Kalaiarasan B Syncfusion Team July 31, 2012 11:33 AM UTC

Hi Sascha,

We are glad to hear that the issue is resolved on your side.

Please let us know if you have any other concerns

Thanks,
Kalai



Loader.
Live Chat Icon For mobile
Up arrow icon