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
570
Extra ColumnHeader Rows On Export Selected Rows
posted

 In my application, I have a grid with a maximum of two bands.  When the user makes a context menu selection on band[0] to export to excel, all selected rows in band[0] will be exported along with any child rows in band[1].  When I do this, I get extra ColumnHeader rows in my excel.  Is there a way to only get the ColumnHeader rows for the for the rows that I am exporting?

 Here is the code I am using to handle the selected row export:

      private void ultraGridExcelExporter1_RowExporting(object sender, Infragistics.Win.UltraWinGrid.ExcelExport.RowExportingEventArgs e) {
         UltraGrid grid = e.GridRow.Band.Layout.Grid as UltraGrid;
         UltraGridRow realGridRow = grid.GetRowFromPrintRow(e.GridRow);
         
         if (realGridRow.Band.Index == 0 && realGridRow.Selected == false) {
            e.Cancel = true;
         } else if (realGridRow.Band.Index == 1 && realGridRow.ParentRow.Selected == false) {
            e.Cancel = true;
         }
      }

 Any help is appreciated.

Thanks,

Justin

 

 

 

Parents Reply Children