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

Serialization

Thread ID:

Created:

Updated:

Platform:

Replies:

17634 Aug 13,2004 04:29 AM UTC Aug 13,2004 11:22 AM UTC Windows Forms 1
loading
Tags: GridControl
c#risti
Asked On August 13, 2004 04:29 AM UTC

Hi I''m evaluating GridGroupingControl. I manage to group dates, to filter them and to serialize them in an XML format. As I noticed, when serializing, the table or sql on which grid is filled, it is not saved in the XML file. I''ve tried to use TableDescriptor.Name property it''s ok for data that are not grouped, but when I group data after a column, the TableDescriptor.Name proprety is changed to "Default" value. Please give me an example about how to serialize the source of GridGroupingControl togheter with the rest of the data. Thanks

Administrator [Syncfusion]
Replied On August 13, 2004 11:22 AM UTC

Hi Christi, check out the CategoryView example. You can modify its SaveSchema and LoadSchema methods to also save and load the dataset. private void btnSaveXmlSchema_Click(object sender, System.EventArgs e) { FileDialog dlg = new SaveFileDialog(); dlg.AddExtension = true; dlg.Filter = "xml files (*.xml)|*.xml|All files (*.*)|*.*" ; if (dlg.ShowDialog() == DialogResult.OK) { XmlTextWriter xw = new XmlTextWriter(dlg.FileName, System.Text.Encoding.UTF8); this.gridGroupingControl1.WriteXmlSchema(xw); xw.Close(); this.dataSet11.WriteXml("NWCategories.xml", XmlWriteMode.WriteSchema); } } private void btnLoadXmlSchema_Click(object sender, System.EventArgs e) { FileDialog dlg = new OpenFileDialog(); dlg.Filter = "xml files (*.xml)|*.xml|All files (*.*)|*.*" ; if (dlg.ShowDialog() == DialogResult.OK) { XmlReader xr = new XmlTextReader(dlg.FileName); ApplySchema(xr, Path.GetFileName(dlg.FileName), "Engine Schema (" + Path.GetFileName(dlg.FileName) + ")"); xr.Close(); this.dataSet11 = new DataSet1(); ReadXml(this.dataSet11, "NWCategories.xml"); this.gridGroupingControl1.DataSource = this.dataSet11.Categories; this.gridGroupingControl1.DataMember = null; } } void ApplySchema(XmlReader xr, string info, string undoDescription) { GridEngine engine = GridEngine.CreateFromXml(xr); if (engine != null) this.gridGroupingControl1.Engine.InitializeFrom(engine); } I attached a modified form1.cs file. Form1_4970.zip Stefan

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

;