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. Image for the cookie policy date

Exporting to Excel - Documentation is incomplete

Grid Excel export toolbar on click method:
public toolbarClick = (args: ClickEventArgs) => {
    if (this.grid && args.item.id === 'grid_excelexport') {
        this.grid.excelExport();
    }
  }

This was taken from the documentation, except that, args.item.id is 'grid_excelexport' only if the grid id is "grid", if I don't set grid ID or in the case of a child grid, the grid ID is dynamic and it is not possible to intercept the call.


1 Reply

PK Prasanna Kumar Viswanathan Syncfusion Team January 14, 2020 11:46 AM UTC

Hi Matteo, 
 
Thanks for contacting Syncfusion support. 
 
In toolbarClick event we suggest you ensure with text value for Excel, PDF and Word Exporting. For more information, please refer the below code example: 
 
 
toolbarClick(args) { 
        switch (args.item.text) { 
            case 'PDF Export': 
                this.gridInstance.pdfExport(); 
                break; 
            case 'Excel Export': 
                this.gridInstance.excelExport(); 
                break; 
            case 'CSV Export': 
                this.gridInstance.csvExport(); 
                break; 
        } 
    } 
 
 
Regards, 
Prasanna Kumar N.S.V 


Loader.
Live Chat Icon For mobile
Up arrow icon