New to Kendo UI for jQueryStart a free 30-day trial

Insert Rows When Exporting the Grid to Excel

Environment

ProductProgress® Kendo UI® Grid for jQuery
Product Version2017.2.621

Description

How can I intercept the Excel export of the Kendo UI Grid and add data to the exported file?

Solution

When the excelExport event is fired, access the configuration object of the Excel workbook and add rows to its sheets in the e.workbook property.

js
       function excelExport(e) {
        console.log(e.workbook.sheets[0].rows)
        e.workbook.sheets[0].rows.unshift(
            {
                cells: [
                    {
                        value: "Some content",
                        background: "#7a7a7a",
                        colSpan: 2,
                        color: "#fff",
                        rowSpan: 2
                    }
                ]
            } )
    }
In this article
EnvironmentDescriptionSolution
Not finding the help you need?
Contact Support