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
No Data
Reply
  • 195
    posted

    I've implemented exporting the grid (as seen on screen, hidden bands and columns not exported) using: 

        ultraGridExcelExporter1.Export(uGrid, exportFileName);

     this appears to have been around since 5.1...though i've only used it since 7.

     if you look to http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.Aspx?ArticleID=10038  (article for export WITH hidden columns)

    'Use the UltraGridExcelExporter’s Export method to export the WinGrid. Handle the BeginExport event of the UltraGridExcelExporter and unhide ny columns you want. Save the sheet to a local directory on the machine.'

Children