Edit this page

Include Hidden Grid Columns in Exported Excel Files

Environment

Product Grid for ProgressĀ® Kendo UIĀ®
Product Version 2018.2.516

Description

How can I show some of the hidden columns of the Grid in the exported Excel file?

Solution

Use the hideColumn or showColumn methods to change the visibility of the columns before and after the export and utilize the excelExport event.

The following code snippet demonstrates the implementation of the suggested approach.

var exportFlag = false;
$("#grid").data("kendoGrid").bind("excelExport", function (e) {
    if (!exportFlag) {
        e.sender.hideColumn(1);
        e.preventDefault();
        exportFlag = true;
        setTimeout(function () {
            e.sender.saveAsExcel();
        });
    } else {
        e.sender.showColumn(1);
        exportFlag = false;
    }
});

See Also

Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy