Version

HeaderType Property (HeaderRowExportingEventArgs)

Type of header.
Syntax
'Declaration
 
Public ReadOnly Property HeaderType As HeaderTypes
public HeaderTypes HeaderType {get;}
Example
Following code uses HeaderRowExporting event to apply custom formatting to grid header row appearance (before grid header row export has started) and HeaderRowExported event to apply custom formatting to excel row (after grid row header was exported).

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

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;
}
Requirements

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

See Also