Empty row after XLS export.

4 posts, 1 answers
  1. JAVIER BABUGLIA
    JAVIER BABUGLIA avatar
    5 posts
    Member since:
    Jun 2010

    Posted 01 Aug 2018 Link to this post

    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.
  2. Answer
    Vessy
    Admin
    Vessy avatar
    2280 posts

    Posted 06 Aug 2018 Link to this post

    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.
  3. JAVIER BABUGLIA
    JAVIER BABUGLIA avatar
    5 posts
    Member since:
    Jun 2010

    Posted 07 Aug 2018 in reply to Vessy Link to this post

    Works like a charm. 

    Thank you.
  4. Vessy
    Admin
    Vessy avatar
    2280 posts

    Posted 07 Aug 2018 Link to this post

    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.
Back to Top