New to Telerik UI for ASP.NET AJAXStart a 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

ASP.NET
<telerik:RadGrid ID="RadGrid1" runat="server" OnGridExporting="RadGrid1_GridExporting">
</telerik:RadGrid>

In the Code behind

C#
protected void Page_Init(object sender, EventArgs e)
{
    RadGrid1.GridExporting += RadGrid1_GridExporting;
}

The event handler

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

}

See Also