I am hiding the detail template item in the OnItemDataBound method which works, but this causes a blank row when I export to Excel. How can the row be removed completely?
Dim item = CType(e.Item, GridDataItem)
item.DetailTemplateItemDataCell.Visible = false
2 Answers, 1 is accepted
0
Accepted
Attila Antal
Telerik team
answered on 13 Apr 2020, 03:10 PM
Hi Benjamin,
The method from your description only hides the Cell inside the DetailTemplateItem, but the item itself remains visible.
To hide them when exporting, try the following example:
protectedvoidRadGrid1_PreRender(object sender, EventArgs e)
{
if (RadGrid1.IsExporting)
{
foreach (GridDetailTemplateItem detailTemplateItem in RadGrid1.MasterTableView.GetItems(GridItemType.DetailTemplateItem))
{
detailTemplateItem.Visible = false;
}
}
}
Kind regards,
Attila Antal
Progress Telerik
Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic. Our thoughts here at Progress are with those affected by the outbreak.