How do I remove rows on Biff Export? I want them to be visible in the app but removed when exported if a particular column has a null value.
1 Answer, 1 is accepted
0
Doncho
Telerik team
answered on 23 Feb 2021, 01:07 PM
Hi Jerry,
You can set the Visible property of certain GridDataItems to false when the RadGrid is being rendered for exporting, see Hiding Columns / Rows
For example, in the PreRender event of the grid, check if the RadGrid is being exported, and loop through its items to disable the visibility of the desired rows:
protectedvoidRadGrid1_PreRender(object sender, EventArgs e)
{
if (RadGrid1.IsExporting)
{
var dataItems = RadGrid1.Items;
foreach (GridDataItem item in dataItems)
{
//opt1. check for the text in a cell//if (string.IsNullOrEmpty(item["ShipName"].Text))//opt2. get a key valueif (item.GetDataKeyValue("OrderID").ToString() == "6")
{
item.Visible = false;
}
}
}
}
I hope this will help. Please let me know if you have further questions.
Kind regards,
Doncho
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 https://learn.telerik.com/.