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

Grid export to PDF/Excel

3 Answers 48 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ricky
Top achievements
Rank 1
Ricky asked on 21 Jan 2013, 09:23 AM
Good day

Is there anyway I can modify this demo: http://demos.telerik.com/aspnet-mvc/grid/customcommand
to export the grid to PDF or Excel format?

Thank you.

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 21 Jan 2013, 09:46 AM
Hi,

Try the following code to achieve your scenario.
aspx:
<CommandItemTemplate>
  <asp:Button ID="Export" runat="server" Text="export" OnClick="Export_Click" />
</CommandItemTemplate>
C#:
protected void Export_Click(object sender, EventArgs e)
{
  RadGrid1.MasterTableView.ExportToPdf();
}

Thanks,
Princy
0
Ricky
Top achievements
Rank 1
answered on 21 Jan 2013, 11:36 AM
I'm not using RadGrids, only the regular Html.Telerik().Grid<T>(), that is populated by SQL data, that is databound via AJAX.

Is there References I should add to achieve your proposal code?
And the C# code, is it set in the controller?

Thank you
0
Kostadin
Telerik team
answered on 24 Jan 2013, 09:41 AM
Hi,

You could check out the following help topic where is elaborate more on this scenario. Please keep in mind that choosing the exact product tree related to the issue will enable us to respond more quickly and efficiently to your posts.

Kind regards,
Kostadin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Ricky
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Ricky
Top achievements
Rank 1
Kostadin
Telerik team
Share this question
or