New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

OnGridExporting Event

Fired when RadGrid is exported to Excel/Word/Csv/Pdf before the resulting document is rendered on the client.

Event Parameters

  • (object) sender

    • The control that fires the event
  • (GridExportingArgs) e

    • Event arguments

      • (string) e.ExportOutput

        Contains export document which will be written to the response.

      • (ExportType) e.ExportType

        Gets the type of the export.

Attaching the event

In the Markup

<telerik:RadGrid ID="RadGrid1" runat="server" OnGridExporting="RadGrid1_GridExporting">

In the Code behind

protected void Page_Init(object sender, EventArgs e)
    RadGrid1.GridExporting += RadGrid1_GridExporting;
Protected Sub Page_Init(sender As Object, e As EventArgs) Handles Me.Init
    AddHandler RadGrid1.GridExporting, AddressOf RadGrid1_GridExporting
End Sub

The event handler

protected void RadGrid1_GridExporting(object sender, GridExportingArgs e)
    string exportOutput = e.ExportOutput;
    ExportType exportType = e.ExportType;

Protected Sub RadGrid1_GridExporting(ByVal sender As Object, ByVal e As GridExportingArgs)
    Dim exportOutput As String = e.ExportOutput
    Dim exportType As ExportType = e.ExportType
End Sub

## See Also

In this article