I am troubleshooting a program that someone else wrote and there is a grid that is missing a few column headers upon export to excel. The column headers and data showed up on screen but not on excel export. The first few columns would have headers and the rest of the columns displayed data but no headers. In the method that gets called by OnItemCommand, I have tried changing the header text by doing this:
gridMasterTableView.GetColumn(I).HeaderText = I;
but it doesn't seem to change anything on the excel.
In the method that is called by OnItemDataBound I tried to put a breakpoint on this line:
GridHeaderItem header = (GridHeaderItem)e.Item;
In the GridHeaderItem I noticed it only has a few of the columns.
I just want to fill the missing column headers. Is there a good place where I can access the datatable that gets exported to excel and put in the headers? In other words, if I only want to control what column name to put on excel export without touching the original source data, what would be a good place to do it and how to go about doing that?
Thanks.