I have a RadGrid that shows or hides data in a certain row based on some logic in my RadGrid1_ItemDataBound method.
I am trying to show the column and only certain rows on the export.
RadGrid
First Name MVP
Fred Yes
John No
Bill
Stan Yes
Jack Yes
Export to Excel
First Name MVP
Fred Yes
John No
Bill Yes
Stan Yes
Jack Yes
As you can see I can hide "Yes" in the codebehind of the RadGrid1_ItemDataBind method, but it appears in the Export.
How can I get "Yes" to NOT appear in the export to excel?
I am trying to show the column and only certain rows on the export.
RadGrid
First Name MVP
Fred Yes
John No
Bill
Stan Yes
Jack Yes
Export to Excel
First Name MVP
Fred Yes
John No
Bill Yes
Stan Yes
Jack Yes
As you can see I can hide "Yes" in the codebehind of the RadGrid1_ItemDataBind method, but it appears in the Export.
How can I get "Yes" to NOT appear in the export to excel?
protected void ButtonExcel_Click(object sender, System.EventArgs e)
{
ConfigureExport();
RadGrid Grid1 = (RadGrid)Page.Master.FindControl("Main").FindControl("RadGrid1");
Grid1.MasterTableView.GetColumn("mvp").Display = true;
// Logic here to hide certain data in the based on the MVP value
Grid1.MasterTableView.ExportToExcel();
}