I have a gridview, gridViewOrders
, with master-detail relationship. I am hiding default values for the column OrderedDate
in gridViewOrders_CustomUnboundColumnData
event as follows
if((DateTime)e.Value == DEFAULT_DATE)
{
e.Value = null;
}
When I try to export the same grid (using gridViewOrders.ExportToXls(fileName)
) to an Xls; these hidden values are shown in the excel as exported excel file which something not intended. I want the detail row not to display the value if it = DEFAULT_DATE
(DEFAULT_DATE = 01/01/2000
).
MainView
Id Name OrderedDate 1 K_23 2 J_11 12/03/2019 3 K_4 15/02/2020 4 P_3
Exported to XLS
Id Name OrderedDate 1 K_23 01/01/2000 2 J_11 12/03/2019 3 K_4 15/02/2020 4 P_3 01/01/2000