I have tow question
1: when i use radgridview.print the cells content truncated is there a way to set "can grow" property to eliminate this.
2: is there a way to add a picture at the top of printed document?? or i must build a report to print a table?.
3 Answers, 1 is accepted
Thank you for writing.
1. You should make sure that there is enough space on the page for all columns (if not you can change page orientation or use smaller fonts). In addition make sure that FitWidthMode of the print style is set to FitPageWidth. More information is available in the following articles:
2. You can create a RadPrintDocument and use its PrintPage event to draw the image:
private
void
radButton1_Click(
object
sender, EventArgs e)
{
RadPrintDocument doc =
new
RadPrintDocument();
doc.AssociatedObject =
this
.radGridView1;
doc.DefaultPageSettings.Margins =
new
System.Drawing.Printing.Margins(30, 30, 50, 30);
doc.PrintPage += doc_PrintPage;
RadPrintPreviewDialog dialog =
new
RadPrintPreviewDialog(doc);
dialog.Show();
}
private
void
doc_PrintPage(
object
sender, System.Drawing.Printing.PrintPageEventArgs e)
{
Image img = Image.FromFile(@
"C:\img\delete.png"
);
e.Graphics.DrawImage(img, e.MarginBounds.X, e.MarginBounds.Y - 20);
}
Please let me know if there is something else I can help you with.
Regards,
Dimitar
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
Hi Dimitar!
I have a doubt about this solution:
https://feedback.telerik.com/Project/154/Feedback/Details/214367-fix-radgridview-incorrect-row-height-when-the-rows-are-auto-sized-and-the-font
I used your implementation from this link in test project and that solution works perfectaly! Thanks!
But, When I click on "Print Settings" button and I choose the landscape orientation option and I click on "Preview", the issue occurs again. It seems like preview it loses the initial configurations made in MyPrintStyle class...
You can reproduce the issue using the same attached project in link.
Could you help me?
How I can to use a workaround for this issue?
Best regards,
Max
Which version of the suite are you using? I have tested this and on my side and it works correctly. I have attached a video that shows what I am doing.
I am looking forward to your reply.
Dimitar
Progress Telerik