New to Telerik UI for ASP.NET AJAX? Start 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.ExportOutputContains export document which will be written to the response.
-
(ExportType)
e.ExportTypeGets 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;
}