OnPdfExporting Event

Fired when RadGrid is exported to Pdf before the resulting document is rendered on the client. Appropriate for customizing the grid table appearance in the .pdf document.

Event Parameters

  • (object) sender

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

    • Event arguments

      • (string) e.RawHTML

        Contains the RadGrid`s HTML which will be transformed to PDF

Attaching the event

In the Markup

<telerik:RadGrid ID="RadGrid1" runat="server" OnPdfExporting="RadGrid1_PdfExporting">
</telerik:RadGrid>

In the Code behind

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

The event handler

protected void RadGrid1_PdfExporting(object sender, GridPdfExportingArgs e)
{
    string rawHtml = e.RawHTML;
}
Protected Sub RadGrid1_PdfExporting(ByVal sender As Object, ByVal e As GridPdfExportingArgs)
    Dim rawHtml As String = e.RawHTML
End Sub
In this article
Not finding the help you need? Improve this article