Hi,
I have a grid where a user can hide/show columns using the FieldChooser (using the ShowColumnChooser). I now want to export to excel the visible columns. In order to do this I have implemented the following event handler:
private void ultraGridExcelExporter1_CellExporting(object sender, Infragistics.Win.UltraWinGrid.ExcelExport.CellExportingEventArgs e)
if (e.GridColumn.Hidden == true) e.Cancel = true;
e.Cancel = true;
}
This doesnt seem to work and exports all columns including the hidden ones. What is the correct solution? What property does the Field chooser change to make the grid columns visible and invisible?
Using version 5.3....
Thanks in advance
You should not have to do anything to prevent hidden columns from exporting. This should happen automatically. You are saying that you have hidden columns in your grid and that when you export to Excel, the hidden columns are being exporting? If that's the case, something is wrong.
Mike,
Unfortunately thats exactly what I am saying. Do you any idea what might be wrong?
Regards
My best guess is that you are modifying the export layout somehow to make the columns visible. Maybe you are creating a new layout somewhere? Or using BeginExport and modifying the layout passed in?
Or this could be a bug, but that seems pretty unlikely, since someone would have noticed it by now. Are you using an old version of the grid?