How to exclude columns during export

2 posts, 1 answers
  1. J
    J avatar
    6 posts
    Member since:
    Apr 2017

    Posted 18 Sep Link to this post


    I'm using this code in my grid:


       .ToolBar(tools => tools.Excel())
         .Excel(excel => excel
            .ProxyURL(Url.Action("ExportExcelSave", "Ci"))

    My question is; how can I exclude some columns from my Excel?




  2. Answer
    Georgi avatar
    182 posts

    Posted 21 Sep Link to this post


    Possible solution is to hide the columns you want to exclude when the excelExport event is fired. The following code block illustrates how to hide a column before the export and then show it back after the export is done:

    var exportFlag = false;
    $("#grid").data("kendoGrid").bind("excelExport", function (e) {
        if (!exportFlag) {
            e.sender.hideColumn(1); // index of the column you want to exclude
            exportFlag = true;
            setTimeout(function () {
        } else {
            exportFlag = false;
    Please give it a try and let me know if it works for you.

    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top