I am using Ignite UI. In that I am using Igx grid, I am able to export excel of all data using IgxExcelExporterService
, but I want to export only selected data by using onRowSelectionChange
method of igx grid
. Is there any way igx-grid
support this functionality?
Asked
Active
Viewed 463 times
2

Zdravko Kolev
- 1,569
- 14
- 20
1 Answers
1
You can use the Excel Exporter service:
this.excelExportService.
exportData
(this.data, ..).
Go ahead and pass a data array
to the service. How to fill the data array with the selected rows data? Here you can find a code snippet for bootstrapping your POC:
Actual code:
public clicked() {
let selectedRows = this.grid1.selectedRows;
for (let rowIndex of selectedRows) {
let rowData = this.grid1.getRowByIndex(rowIndex).rowData;
this.exportData.push(rowData);
}
console.log(this.exportData);
this.excelExportService.exportData(this.exportData,
new IgxExcelExporterOptions("ExportedDataFile"));
this.exportData = [];
}
This Export excel topic will help you any further.
Use this for a starting point with the igxGrid row selection.

Konstantin Dinev
- 34,219
- 14
- 75
- 100

Zdravko Kolev
- 1,569
- 14
- 20