Version

SummaryRowExporting Event

Occurs before summary row is exported to excel.
Syntax
'Declaration
 
Public Event SummaryRowExporting As SummaryRowExportingEventHandler
public event SummaryRowExportingEventHandler SummaryRowExporting
Event Data

The event handler receives an argument of type SummaryRowExportingEventArgs containing data related to this event. The following SummaryRowExportingEventArgs properties provide information specific to this event.

PropertyDescription
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.
Summaries Summary values.
SummaryLevel Summary level.
Workbook (Inherited from Infragistics.Win.UltraWinGrid.ExcelExport.ExcelExportCancelEventArgs)Exporting workbook.
Remarks

The Summaries argument returns a reference to summary values.

The SummaryLevel argument returns a current summary level.

Additionaly this event has Cancel, Workbook, CurrentWorksheet, CurrentRowIndex, CurrentColumnIndex, CurrentOutlineLevel arguments inherited from ExcelExportCancelEventArgs.

This event is fired before excel row with summary values for specific level is processed. Use Cancel argument to cancel row exporting. If summaries span multiple Excel rows (like in row layout mode), this event is fired only for first row of summaries.

Example
Following code uses SummaryRowExporting event to apply custom formatting to grid summary row appearance (before grid summary row export has started) and SummaryRowExported event to apply custom formatting to excel row (after summary grid row 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_SummaryRowExporting(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.ExcelExport.SummaryRowExportingEventArgs) Handles MyGridExporter.SummaryRowExporting
    If e.SummaryLevel Mod 2 = 0 Then
        e.Summaries(0).Appearance.BackColor = Color.LightCoral
    End If
End Sub

Private Sub MyGridExporter_SummaryRowExported(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.ExcelExport.SummaryRowExportedEventArgs) Handles MyGridExporter.SummaryRowExported
    If e.SummaryLevel Mod 2 = 0 Then
        e.CurrentWorksheet.Rows(e.CurrentRowIndex - 1).CellFormat.Font.Bold = ExcelDefaultableBoolean.True
    End If
End Sub
private void SummaryRowExportingEH(object sender, Infragistics.Win.UltraWinGrid.ExcelExport.SummaryRowExportingEventArgs e)
{
	if(e.SummaryLevel%2==0)
		e.Summaries[0].Appearance.BackColor = Color.LightCoral;		
}

private void SummaryRowExportedEH(object sender, Infragistics.Win.UltraWinGrid.ExcelExport.SummaryRowExportedEventArgs e)
{
	if(e.SummaryLevel%2==0)
		e.CurrentWorksheet.Rows[e.CurrentRowIndex-1].CellFormat.Font.Bold = ExcelDefaultableBoolean.True;		
}
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