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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Serializing GridGroupingControl

Thread ID:

Created:

Updated:

Platform:

Replies:

41724 Mar 9,2006 05:38 PM UTC Mar 10,2006 05:31 PM UTC Windows Forms 2
loading
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

GridGroupingControl_XmlSchema.zip

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.

CONFIRMATION

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.

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

;