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

Auto Rows Height in Print

1 Answer 79 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sandogh
Top achievements
Rank 1
Sandogh asked on 03 Jul 2016, 06:42 AM

I use the following code to change fonts size in print:

1.void grid_PrintCellFormatting(object sender, PrintCellFormattingEventArgs e)
2.{
3.    e.PrintCell.Font = new Font("Tahoma", 14, FontStyle.Regular);
4.}

Now, how can I make auto size the rows height in print without using the AutoSizeRows property of grid?

1 Answer, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 04 Jul 2016, 02:49 PM
Hello ,

Thank you for writing.

The height of the printed rows is determined by the height of the actual rows in the grid. Please check this thread discussing a similar question: http://www.telerik.com/forums/spacing-between-rows-in-print-preview.

Considering your described scenario I can suggest setting the AutoSizeProperty to true before printing and then setting it back to false. Additionally, you may consider using a GridPrintStyle object and set the font to the CellFont property. This way you would not need to handle the PrintCellFormatting.

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo Merdjanov
Telerik
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms. For more information check out this blog post and share your thoughts.
Tags
GridView
Asked by
Sandogh
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or