Read filtered data on GridGroupingControl
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 ;-)
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
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...)?
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/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.
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.
- 6 Replies
- 4 Participants
-
RI Rits
- Sep 16, 2013 02:57 PM UTC
- Aug 6, 2015 08:58 AM UTC