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

Serialize filtered datatable in XML

Thread ID:





46772 Jul 20,2006 09:50 AM UTC Jul 24,2006 10:48 AM UTC General Discussion 4
Tags: General Discussion
Karsten Brocksieper
Asked On July 20, 2006 09:50 AM UTC


even if I know that there is a special forum for the GGC I want to ask my question in this forum because I think that it´s a general question.

I use the Filterbar feature in a GGC and need to serialize the filtered data in XML with the WriteXML method of the datatable object in the following way.

Dim xw As New XmlTextWriter("c:\temp\apoInventarListe.xml", System.Text.Encoding.UTF8)
xw.Formatting = Formatting.Indented
Dim dt As DataTable = Me.grdgrpXLImport.DataSource
dt.WriteXml(xw, XmlWriteMode.WriteSchema)
Catch ex As Exception
End Try

But as a result of this code I always get the complete datatable and not only the filtered rows from the GGC.

Can anyone help me to serialize only the filtered rows of a datatable.

Thank you very much

Administrator [Syncfusion]
Replied On July 21, 2006 12:39 PM UTC

Hi Karsten,

Please refer the forum thread for Serialize grouping table descriptor.

You can Save the GridEngine changes to xml using the Engine.WriteXml method and intialize GridEngine from Xml using CreateFromXml method. Here is a code snippet.

// intialize GridEngine from Xml
System.IO.FileStream file = new FileStream("XML11.xml",FileMode.Open);
System.Xml.XmlTextReader xr = new System.Xml.XmlTextReader(file);
GridEngine engine = GridEngine.CreateFromXml(xr);

//GridEngine changes to xml
System.IO.FileStream file = new FileStream("XML11.xml",FileMode.OpenOrCreate);
System.Xml.XmlTextWriter writer = new System.Xml.XmlTextWriter(file,System.Text.Encoding.UTF8 );
this.gridGroupingControl1.Engine.WriteXml( writer);

Best regards,

Karsten Brocksieper
Replied On July 21, 2006 06:09 PM UTC

Hi Haneef,

thank you for your answer but unfortunately your suggestion is not the solution in my case.

With your suggested code and the link I can serialize the schema of the grid but not the data itself.

For example: I have a GGC with about 50 items in the datasource of the grid. Now I filter with the filterbar method and as a result there are at least only 10 items in the grid.

My problem is now that -with my code- I ALWAYS get 50 items in my XML file regardless of the filter settings.

What I want to do is just getting the filtered resultset in my serialized XML file and not all of the data from my underlying datatable.

It would be really helpful for me if you can help me.

Thank you in advance
Regards, Karsten

Karsten Brocksieper
Replied On July 22, 2006 10:58 AM UTC


in the meantime I have found that the visible (=filtered) records are in the FilteredRecords collection (Me.GridGrouping.Table.FilteredRecords). But actually I´m having the problem that I can´t get this collection in a DataTable object.

Can anyone help me with this?

Regards, Karsten

Administrator [Syncfusion]
Replied On July 24, 2006 10:48 AM UTC

Hi Karsten,

Please refer the forum thread for more details.

Let me know if this helps.
Best Regards,


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