Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exporting to Excel using Telerik RadGrid adds a blank row in place of the Filter Row

I'm using a RadGrid with column filtering turned on. When I export data to Excel I always get an extra row at the top and bottom of the data that seems to be because of the filter row. It appears between the column headers and the data. Is there any way to hide this?

like image 901
Rory Avatar asked Dec 05 '25 10:12

Rory


1 Answers

void Button1_Click(object sender, EventArgs e)
{
    exporting = true;
    RadGrid1.Rebind();
    RadGrid1.MasterTableView.ExportToExcel();
}

void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
    if (exporting && e.Item.ItemType == Telerik.Web.UI.GridItemType.FilteringItem)
    {
        e.Item.Visible = false;
    }
}
like image 111
Yuriy Rozhovetskiy Avatar answered Dec 08 '25 00:12

Yuriy Rozhovetskiy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!