Version

EndExport Event

Occurs after grid export is finished.
Syntax
'Declaration
 
Public Event EndExport As EndExportEventHandler
public event EndExportEventHandler EndExport
Event Data

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

PropertyDescription
Canceled True if exporting process was been canceled.
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.
Workbook (Inherited from Infragistics.Win.UltraWinGrid.ExcelExport.ExcelExportEventArgs)Exporting workbook.
Remarks

The Canceled argument is true if exporting process was been canceled.

This event has Workbook, CurrentWorksheet, CurrentRowIndex, CurrentColumnIndex, CurrentOutlineLevel arguments inherited from ExcelExportEventArgs.

This event is fired after exporting process is finished and is fired after all other events. Use this event for any post processing of excel workbook.

Example
Following code uses BeginExport and EndExport events to write additional information to workbook. Additional data is entered in separate worksheet, which is created in BeginExport event handler.

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_BeginExport(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.ExcelExport.BeginExportEventArgs) Handles MyGridExporter.BeginExport
    Dim ws As Worksheet
    ws = e.CurrentWorksheet.Workbook.Worksheets.Add("InfoSheet")

    ws.Columns(1).Width = 20 * 256
    ws.Columns(2).Width = 20 * 256

    ws.Rows(1).Cells(1).Value = "Export started at:"
    ws.Rows(1).Cells(2).Value = DateTime.Now

    e.CurrentWorksheet.Workbook.ActiveWorksheet = ws
End Sub

Private Sub MyGridExporter_EndExport(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.ExcelExport.EndExportEventArgs) Handles MyGridExporter.EndExport
    Dim ws As Worksheet
    ws = e.CurrentWorksheet.Workbook.Worksheets("InfoSheet")

    ws.Rows(2).Cells(1).Value = "Export successful!"
End Sub
public void BeginExportEH(object sender, BeginExportEventArgs e)
{
	Worksheet ws = e.CurrentWorksheet.Workbook.Worksheets.Add("InfoSheet");

	ws.Columns[1].Width = 20*256;
	ws.Columns[2].Width = 20*256;

	ws.Rows[1].Cells[1].Value = "Export started at:";
	ws.Rows[1].Cells[2].Value = DateTime.Now;

	e.CurrentWorksheet.Workbook.ActiveWorksheet = ws;

}

public void EndExportEH(object sender, EndExportEventArgs e)
{
	Worksheet ws = e.CurrentWorksheet.Workbook.Worksheets["InfoSheet"];
	
	ws.Rows[2].Cells[1].Value = "Export successful!";
}
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