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

How to export radgridview to pdf on a button click in c# winforms

2 Answers 213 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Srinath
Top achievements
Rank 1
Srinath asked on 05 Oct 2012, 07:43 PM
private void button1_Click(object sender, EventArgs e)
        {

            ExportToPDF exporter = new ExportToPDF(this.radGridView1);
            exporter.FileExtension = "pdf";
            //exporter.HiddenColumnOption = Telerik.WinControls.UI.Export.HiddenOption.DoNotExport;
            exporter.FitToPageWidth = true;
            string fileName = "c:\\Directory-information.pdf";
            exporter.RunExport(fileName);

        }

Im beginner in .net, what ever experienced people teach is me what I learn. Help me with this issue , I will be very much thankful to you all.

2 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 10 Oct 2012, 01:35 PM
Hello Srinath,

Thank you for writing.

The code provided works correctly on my end. Could you please specify what is the issue that you experience?

More information about the exporting mechanism can be found here: http://www.telerik.com/help/winforms/gridview-exporting-data-export-to-pdf.html.

I hope this helps.
 
All the best,
Stefan
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
0
Jeremiah
Top achievements
Rank 1
answered on 19 Feb 2019, 10:02 AM
ZetPDF.com is the best PDF library in the market. I have tried many of others and they either aren’t as simple or simply don’t have the features like ZetPDF.com
Tags
GridView
Asked by
Srinath
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Jeremiah
Top achievements
Rank 1
Share this question
or