Last Updated: 26 Mar 2021 16:06 by ADMIN
Release R1 2021 SP2
Created on: 19 Feb 2021 12:53
Category: Grid
Type: Bug Report
Export to Xslx adding blank row for filter item in R1 2021
Empty row is added for the filter item in the export file, even if the [FilteringItem].Visible is set to false.
Posted on: 26 Mar 2021 16:06

Hi James,

The problem has been resolved and the fix will appear on March 30, 2021, with the R1 2021 SP2 release.

Kind regards,
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Posted on: 05 Mar 2021 15:19

Workaround for the issue:

  • Prevent the default export functionality by canceling the ExportToExcel command in the ItemCommand event. 
  • Generate a Workbook out of the RadGrid using the GenerateXslxOutput<Workbook>() method, introduced in R1 2021. (Creating the workbook will give you the flexibility to modify and adjust the structure).
  • Remove the rows corresponding to the filtering item and to command item (if such is shown) from the Workbook.
  • Export the modified Workbook to xlsx file with the XlsxFormatProvider  and send it as a response to the browser.

C# code:


protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
    if (e.CommandName == RadGrid.ExportToExcelCommandName)
        //prevent the default exporting
        e.Canceled = true;

        //generate Workbook out of the Grid for exporting
        DPL.Workbook workbook = RadGrid1.MasterTableView.GenerateXlsxOutput<DPL.Workbook>() as DPL.Workbook;
        DPL.Worksheet worksheet = workbook.ActiveSheet as DPL.Worksheet;

        //remove the command item from the exported workbook
        var commandRowIndex = 0;
        DPL.RowSelection commandRow = worksheet.Rows[commandRowIndex];
        //alternative approach to remove the command item
        //RadGrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;

        //remove the filter item from the exported workbook
        var filterRowIndex = 1;
        DPL.RowSelection filterRow = worksheet.Rows[filterRowIndex];

        //export and send to the browser as response
        byte[] data;
        using (MemoryStream ms = new MemoryStream())
            var provider = new XlsxFormatProvider();
            provider.Export(workbook, ms);
            data = ms.ToArray();
        Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
        Response.AppendHeader("Content-Disposition", "attachment; filename=" + RadGrid1.ExportSettings.FileName + ".xlsx");


Kind regards,
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at