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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Serializing GridGroupingControl

Thread ID:





41724 Mar 9,2006 05:38 PM UTC Mar 10,2006 05:31 PM UTC WinForms 2
Tags: GridControl
David Woodstrom
Asked On March 9, 2006 05:38 PM UTC

I am currently using WriteXmlSchema to save the current layout of a GridGroupingControl. However, the xml file is also serializing things I would rather not save. Is there any way I can save, say, what is contained in the TableDescriptor element and ignore the other elements such as Appearance, TopLevelGroupOptions, NestedTableGroupOptions, and TableOptions? Thanks


stanleyj [Syncfusion]
Replied On March 10, 2006 06:32 AM UTC

Hi David, You can Serialize and Deserialize the GridTableDescriptor using System.Xml.Serialization.XmlSerializer to read and write the xml file and hence to store and retrieve information contained in the TableDescriptor alone is possible. // Loading Table Descriptor FileDialog dlg = new OpenFileDialog(); dlg.Filter = "xml files (*.xml)|*.xml|All files (*.*)|*.*" ; if (dlg.ShowDialog() == DialogResult.OK) { XmlSerializer serializer = new XmlSerializer(typeof(GridTableDescriptor)); XmlReader read = new XmlTextReader(dlg.FileName); GridTableDescriptor gtd = serializer.Deserialize(read) as GridTableDescriptor; this.gridGroupingControl1.TableDescriptor.InitializeFrom(gtd); read.Close(); } // Saving TableDescriptor GridEngine engine = this.gridGroupingControl1.Engine; GridTableDescriptor gtd = engine.TableDescriptor; FileDialog dlg = new SaveFileDialog(); dlg.AddExtension = true; dlg.Filter = "xml files (*.xml)|*.xml|All files (*.*)|*.*" ; if (dlg.ShowDialog() == DialogResult.OK) { XmlSerializer serializer = new XmlSerializer(typeof(GridTableDescriptor)); XmlTextWriter write = new XmlTextWriter(dlg.FileName, System.Text.Encoding.UTF8); serializer.Serialize(write, gtd); } Best regards, Stanley

David Woodstrom
Replied On March 10, 2006 05:31 PM UTC

Thanks, that worked.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon