This is a migrated thread and some comments may be shown as answers.

How to create Custom Pdf when 'ExportToPdf' button is clicked

1 Answer 91 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Karan
Top achievements
Rank 1
Karan asked on 01 Feb 2013, 04:04 AM
Hi,

I have activated the export buttons using the ShowExportToPdfButton flag on the Rad Grid Control

I want to handle the event that actually creates the PDF and instead of using the default PDF, I want to create my own PDF.

Please tell me which event I need to override, kindly show an example.

Thanks 

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 01 Feb 2013, 09:05 AM
Hi,

You can  create a Button in the CommandItemTemplate and provide a CommandName, so that you can handle it in the ItemCommand event.

ASPX:
<CommandItemTemplate>
 <asp:Button ID="Export" runat="server" CommandName="YourCommandNameToExport" />
</CommandItemTemplate>

C#:
protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
    if (e.CommandName == "YourCommandNameToExport")
    {
        //your code
    }
}

Thanks,
Shinu.
Tags
Grid
Asked by
Karan
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or