I have a RadGrid with ExportToExcel functionality. This part is working correctly when simply displaying what's on the grid. However I'm having two issues with expanding this functionality:
1) If I add a column to my grid that does not have a "DataField" property it does not get exported. I can work around this by supplying this parameter, but it would be nice if I could just add a column to be exported.
2) When I change the data in the ItemDataBound event, the changes don't come through. In other words, say the column contains the value 3, and in the ItemDataBound event I change it to 20 (see below for how I am doing that), in the Excel document I still see 3 as the output. Note that the code does execute without errors, and also if I export to PDF the correct, updated data does come through, only Excel shows the "old" data.
1) If I add a column to my grid that does not have a "DataField" property it does not get exported. I can work around this by supplying this parameter, but it would be nice if I could just add a column to be exported.
2) When I change the data in the ItemDataBound event, the changes don't come through. In other words, say the column contains the value 3, and in the ItemDataBound event I change it to 20 (see below for how I am doing that), in the Excel document I still see 3 as the output. Note that the code does execute without errors, and also if I export to PDF the correct, updated data does come through, only Excel shows the "old" data.
protected void RadGridHardware_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
GridDataItem dataItem = (GridDataItem)e.Item;
dataItem[
"Quantity"].Text = "20";
}
Any thoughts or ideas?