'Declaration Public Event HeaderRowExporting As HeaderRowExportingEventHandler
public event HeaderRowExportingEventHandler HeaderRowExporting
The event handler receives an argument of type HeaderRowExportingEventArgs containing data related to this event. The following HeaderRowExportingEventArgs properties provide information specific to this event.
Property | Description |
---|---|
Band | UltraGridBand associated with headers. |
Cancel (Inherited from System.ComponentModel.CancelEventArgs) | |
CurrentColumnIndex (Inherited from Infragistics.Win.UltraWinGrid.ExcelExport.ExcelExportCancelEventArgs) | Zero-based index of current exporting column in excel worksheet.. |
CurrentOutlineLevel (Inherited from Infragistics.Win.UltraWinGrid.ExcelExport.ExcelExportCancelEventArgs) | Current outline level used for grouping. |
CurrentRowIndex (Inherited from Infragistics.Win.UltraWinGrid.ExcelExport.ExcelExportCancelEventArgs) | Zero-based index of current exporting row in excel worksheet. |
CurrentWorksheet (Inherited from Infragistics.Win.UltraWinGrid.ExcelExport.ExcelExportCancelEventArgs) | Current exporting worksheet. |
GridRow | UltraGridRow associated with headers. |
HeaderType | Type of header. |
Workbook (Inherited from Infragistics.Win.UltraWinGrid.ExcelExport.ExcelExportCancelEventArgs) | Exporting workbook. |
The Band argument returns a reference to UltraGridBand associated with headers.
The GridRow argument returns a reference to UltraGridRow associated with headers.
The HeaderType argument returns type of header.
Additionaly this event has Cancel, Workbook, CurrentWorksheet, CurrentRowIndex, CurrentColumnIndex, CurrentOutlineLevel arguments inherited from ExcelExportCancelEventArgs.
This event is fired before excel row with header values is processed. Use Cancel argument to cancel row exporting. If headers span multiple Excel rows (like in row layout mode), this event is fired only for first header row.
Private Sub MyGridExporter_HeaderRowExporting(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.ExcelExport.HeaderRowExportingEventArgs) Handles MyGridExporter.HeaderRowExporting If e.HeaderType = HeaderTypes.BandHeader Then e.Band.Header.Appearance.BackColor = Color.LightBlue End If End Sub Private Sub MyGridExporter_HeaderRowExported(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.ExcelExport.HeaderRowExportedEventArgs) Handles MyGridExporter.HeaderRowExported ' CurrentRowIndex is incremented after the row is exported Dim tmRow As WorksheetRow tmRow = e.CurrentWorksheet.Rows(e.CurrentRowIndex - 1) If Not tmRow.Cells(e.CurrentColumnIndex).AssociatedMergedCellsRegion Is Nothing Then ' band header is exported as merged region tmRow.Cells(e.CurrentColumnIndex).CellFormat.Rotation = 45 Else ' column headers are exported as normal cells tmRow.CellFormat.Rotation = 45 End If tmRow.Height = 65 * 20 End Sub
private void HeaderRowExportingEH(object sender, Infragistics.Win.UltraWinGrid.ExcelExport.HeaderRowExportingEventArgs e) { if(e.HeaderType==HeaderTypes.BandHeader) e.Band.Header.Appearance.BackColor = Color.LightBlue; } private void HeaderRowExportedEH(object sender, Infragistics.Win.UltraWinGrid.ExcelExport.HeaderRowExportedEventArgs e) { // CurrentRowIndex is incremented after the row is exported WorksheetRow tmRow = e.CurrentWorksheet.Rows[e.CurrentRowIndex-1]; if(tmRow.Cells[e.CurrentColumnIndex].AssociatedMergedCellsRegion!=null) // band header is exported as merged region tmRow.Cells[e.CurrentColumnIndex].CellFormat.Rotation = 45; else // column headers are exported as normal cells tmRow.CellFormat.Rotation = 45; tmRow.Height = 65*20; }
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2