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

I didn't find RadPrintDocument

3 Answers 154 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Evren
Top achievements
Rank 1
Evren asked on 06 Jun 2012, 03:09 PM
I  have  Telerik winforms Q3 2011 SP1 version. I want to print a gridview but I didn't find RadPrintDocument. Is there any way gridview printing.

3 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 06 Jun 2012, 03:44 PM
Hi Evren,

Thank you for this question.

The printing functionality of RadGridView and RadScheduler was introduced in Q1 2012 as described in our Release Notes. RadPrintDocument is a part of this functionality so you can find it in Q1 2012.

I hope this helps.

Greetings,
Nikolay
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
0
Hugo Furth
Top achievements
Rank 1
answered on 23 Sep 2014, 11:25 PM
Hi All -

I didn't find a topic for RadPrintDocument so posting here.

I am trying to set the papersize to legal before the PrintPreview Method. But it doesn't seem to work.
 
Also would like to set the font of the data cells (as can be done in the PrintPreview window) but can't find the appropriate protperies. Any help appreciated. Here was my best attempt:

        private void rbPrint_Click(object sender, EventArgs e)
            {
            if (radGridView1.RowCount == 0)
                return;
            RadPrintDocument d = new RadPrintDocument();
            System.Drawing.Printing.PaperKind k = System.Drawing.Printing.PaperKind.Legal;
            d.PaperSize.RawKind = (int)k;
            d.DefaultPageSettings.PaperSize.RawKind = (int)k;
  
            d.AssociatedObject = radGridView1;
            d.Landscape = true;
            
            radGridView1.PrintPreview(d);
            }
 
Regards,
Hugo




0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 25 Sep 2014, 01:02 PM
Hello Hugo,

Thank you for writing.

In order to customize the paper size you should specify the RadPrintDocument.DefaultPageSettings.PaperSize property. Here is a sample code snippet:
private void radButton1_Click(object sender, EventArgs e)
{
    if (radGridView1.RowCount == 0)
        return;
    RadPrintDocument d = new RadPrintDocument();          
    d.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize("A2",420,594);
    d.AssociatedObject = radGridView1;
    d.Landscape = true;
     
    radGridView1.PrintPreview(d);
}

You can find additional information in our Telerik Presentation Framework >> Printing Support >> RadPrintDocument section in the online documentation.

I hope this information helps. Should you have further questions, I would be glad to help.

Regards,
Desislava
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
General Discussions
Asked by
Evren
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Hugo Furth
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or