This is a migrated thread and some comments may be shown as answers.

Empty row after XLS export.

3 Answers 339 Views
Grid
This is a migrated thread and some comments may be shown as answers.
JAVIER BABUGLIA
Top achievements
Rank 1
JAVIER BABUGLIA asked on 01 Aug 2018, 09:37 AM

Hi, I'm having troubles removing a blank row in my export file (See example1);

The only thing I have between the rows is an "EditItemTemplate" where I update the row.(check example2).
Is that what's causing it?

My export code:

            gridOrdenes.ExportSettings.IgnorePaging = true;
            gridOrdenes.ExportSettings.ExportOnlyData = true;
            gridOrdenes.ExportSettings.OpenInNewWindow = true;
            gridOrdenes.ExportSettings.HideStructureColumns = true;
            gridOrdenes.MasterTableView.ExportToExcel();

Thank you.

3 Answers, 1 is accepted

Sort by
0
Accepted
Vessy
Telerik team
answered on 06 Aug 2018, 12:26 PM
Hi JAVIER,

The filtering and edit rows are exported as blank by default, but you can use the approach from this KB article in order to hide the edit row during the exporting:
https://www.telerik.com/support/kb/aspnet-ajax/grid/details/how-to-remove-the-filter-row-from-excel-export

The type of the items you need to hide for this scenario is GridEditFormType, for example:
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
    if (RadGrid1.IsExporting)
    {
        foreach (GridEditFormItem item in RadGrid1.MasterTableView.GetItems(GridItemType.EditFormItem))
        {
            item.Visible = false;
        }
    }
}


Regards,
Vessy
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
JAVIER BABUGLIA
Top achievements
Rank 1
answered on 07 Aug 2018, 06:28 AM
Works like a charm. 

Thank you.
0
Vessy
Telerik team
answered on 07 Aug 2018, 08:26 AM
Hi,

You are welcome, JAVIER - I am glad the proposed solution served its purposes.

Regards,
Vessy
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
JAVIER BABUGLIA
Top achievements
Rank 1
Answers by
Vessy
Telerik team
JAVIER BABUGLIA
Top achievements
Rank 1
Share this question
or