Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
364
Exporting visible columns only
posted

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;

}

 

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

Parents
  • 469350
    Offline posted

     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. 

Reply Children