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.

Read filtered data on GridGroupingControl

Thread ID:

Created:

Updated:

Platform:

Replies:

112277 Sep 16,2013 10:57 AM Aug 6,2015 04:58 AM Windows Forms 6
loading
Tags: GridControl
Rits
Asked On September 16, 2013 10:57 AM

Hi,
I use this component with GridExcelFilter and it works fine.
But i'am not able to to export filtered datas.

If i use the DataSource i export all my data and not the filtered

my sample :
DataView dtv = gridGroupingControl1.DataSource as DataView;
 DataTable dt = dtv.Table;

then i iterate on the datatable to write my XML, can i get a datable "filtered" ?

ps : sorry for english ;-)

Rits
Replied On September 17, 2013 10:39 AM

Any body has a way to perform this ?

Vinish Kumar K [Syncfusion]
Replied On September 18, 2013 01:05 AM

Hi Rits,

 

Thank you for your interest in Syncfusion products,

 

Query

Can’t able to export filter record

We have analysed the reported issue in our end, I am afraid that I am unable to reproduce the reported issue in our end, we can able to export the record to PDF. Please refer the below code which is we have used in sample.

 

private void button1_Click(object sender, EventArgs e)

        {

            GridPDFConverter pdfConvertor = new GridPDFConverter();

 

            pdfConvertor.ExportToPdf("Sample.pdf", this.gridGroupingControl1.TableControl);

            //Launching the PDF file using the default Application.[Acrobat Reader]

            System.Diagnostics.Process.Start("Sample.pdf");

        }

 

 

Please let me know the below details for us.

 

1.       Which version of Syncfusion product you have used currently.

2.       Are you trying to export Grid to PDF, word or Excel

Query

Can I able to get the filtered DataTable in XML

You can get the filtered table in XML using the XML serialization, please refer the below code and sample from the dashboard.

 

private void btnSaveXmlSchema_Click(object sender, System.EventArgs e)

              {

                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();

              }

 

              private void btnLoadXmlSchema_Click(object sender, System.EventArgs e)

              {

            if (File.Exists("GridSchema.xml") && File.Exists("GridLooknFeel.xml"))

            {

                XmlReader xr = new XmlTextReader("GridSchema.xml");

                XmlReader xrApp = new XmlTextReader("GridLooknFeel.xml");

                this.gridGroupingControl1.ApplyXmlSchema(xr);

                this.gridGroupingControl1.ApplyXmlLookAndFeel(xrApp);

                xr.Close();

                xrApp.Close();

            }

            else

                MessageBox.Show("Click \"Save Xml Schema\" button to serialize the grid.");

              }

 

 

Sample path : <install_location>\Syncfusion\EssentialStudio\11.3.0.30\Windows\Grid.Grouping.Windows\Samples\Serialization\XML Serialization Demo\CS

 

Please let me know if you have any issue along with your sample application this will help us to provide proper response asap.

 

Regards,

Vinish k


Rits
Replied On September 23, 2013 09:59 AM

Hi thanks for your response.
I check it, but don't resolve my problem.

What i want, it's very simple (i hope ;-)).

I have a grid with for example with 2 column  -> "Name" and "Sex".
I use the Excel filter on the colum Sex to get only "Male"
the Grid now display only rows with attribute "Male"

And I want to export what i see, so only the rows filtered "Male"
Can i iterate on the Grid to read these data's and then write into a file ('xml, csv etc...)?


Vinish Kumar K [Syncfusion]
Replied On October 3, 2013 11:54 PM

Hi Rits,

 

Thanks for your update.

 

We have analysed the reported query in our end. Currently Syncfusion GridControl support to export the Grid Data to Excel, pdf, word ,csv and HTML format. So you don’t need to iterate the Grid data source, by default these data export only filtered data.

 

For further reference please refer the below samples from your DashBoard.

 

 <Install_Location>\Syncfusion\EssentialStudio\<Version>\Windows\Grid.Windows\Samples\Exporting\Exporting Demo\CS

 

Please refer the below UG link also for further reference,

 

http://help.syncfusion.com/ug/windows%20forms/grid/default.htm#!Documents/135excelexport.htm

 

http://help.syncfusion.com/ug/windows%20forms/grid/default.htm#!Documents/3163excelconverteroptions.htm

 

http://help.syncfusion.com/ug/windows%20forms/grid/default.htm#!Documents/wordconverter.htm

 

http://help.syncfusion.com/ug/windows%20forms/grid/default.htm#!Documents/414103pdfexport.htm

 

http://help.syncfusion.com/ug/windows%20forms/grid/default.htm#!Documents/excelexport1.htm

 

We hope these will resolve / provide required information about your query.

 

Thanks,

Vinish K.


Sandesh Daddi
Replied On August 5, 2015 09:08 AM

Did you get the answer for this question?

What I want is, list of filtered records from GridGroupingControl. 

I want to create an excel with custom formatting, like My company logo at the Top left, then Report title below that and then all the filtered data from the grid. 

Is it possible by any means?

Thank you,
Sandesh D

Adhikesevan Kothandaraman [Syncfusion]
Replied On August 6, 2015 04:58 AM

Hi Sandesh,

Thank you for your interest in Syncfusion products.

In order to get the filtered records from the grid, you can use the FilteredRecords property. In this collection, the records which are all filtered for particular scenario are maintained. Please make use of below code,

Code Snippet:

FilteredRecordsInTableCollection filteredRecords = this.gridGroupingControl1.Table.FilteredRecords;

Sample:
 http://www.syncfusion.com/downloads/support/directtrac/142357/ze/Filtering-142357856009

Please let me know if you have any concerns.

Regards,
Adhi.


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.

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.

;