'Declaration Public Event HeaderRowExported As HeaderRowExportedEventHandler
public event HeaderRowExportedEventHandler HeaderRowExported
The event handler receives an argument of type HeaderRowExportedEventArgs containing data related to this event. The following HeaderRowExportedEventArgs properties provide information specific to this event.
Property | Description |
---|---|
Band | UltraGrid band associated with headers. |
CurrentColumnIndex (Inherited from Infragistics.Win.UltraWinGrid.ExcelExport.ExcelExportEventArgs) | Zero-based index of current exporting column in excel worksheet. |
CurrentOutlineLevel (Inherited from Infragistics.Win.UltraWinGrid.ExcelExport.ExcelExportEventArgs) | Current outline level used for grouping. |
CurrentRowIndex (Inherited from Infragistics.Win.UltraWinGrid.ExcelExport.ExcelExportEventArgs) | Zero-based index of current exporting row in excel worksheet. |
CurrentWorksheet (Inherited from Infragistics.Win.UltraWinGrid.ExcelExport.ExcelExportEventArgs) | Current exporting worksheet. |
GridRow | UltraGrid row associated with headers. |
HeaderType | Type of header. |
Workbook (Inherited from Infragistics.Win.UltraWinGrid.ExcelExport.ExcelExportEventArgs) | 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 Workbook, CurrentWorksheet, CurrentRowIndex, CurrentColumnIndex, CurrentOutlineLevel arguments inherited from ExcelExportEventArgs.
This event is fired after excel row with header values is processed. Use it to apply any additional formatting to excel row. If headers span multiple Excel rows (like in row layout mode), this event is fired only for last 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