Are there plans to have RadDataEntry implement the IPrintable interface so it can be used with RadPrintDocument?
1 Answer, 1 is accepted
0
George
Telerik team
answered on 21 Oct 2014, 10:32 AM
Hi John,
Thank you for writing.
Currently, there we do not have plans to implement the IPrintable interface for RadDataEntry since we have not had users requesting such functionality. If we receive additional reports we will consider the possibility.
For the time being, you can manually implement the interface:
public class PrintableRadDataEntry : RadDataEntry, IPrintable
{
#region IPrintable Members
public int BeginPrint(RadPrintDocument sender, PrintEventArgs args)
{
return 1;
}
public bool EndPrint(RadPrintDocument sender, PrintEventArgs args)
{
return false;
}
public bool PrintPage(int pageNumber, RadPrintDocument sender, PrintPageEventArgs args)
{
Bitmap bmp = new Bitmap(this.Width, this.Height);
this.DrawToBitmap(bmp, new Rectangle(Point.Empty, this.Size));
args.Graphics.DrawImage(bmp, Point.Empty);
return false;
}
public Form GetSettingsDialog(RadPrintDocument document)
RadPrintPreviewDialog dialog = new RadPrintPreviewDialog(doc);
dialog.ThemeName = this.ThemeName;
dialog.ShowDialog();
}
private RadPrintDocument CreatePrintDocument()
{
RadPrintDocument doc = new RadPrintDocument();
doc.AssociatedObject = this;
return doc;
}
#endregion
}
You can then call the relevant methods.
I hope this helps.
Regards,
George
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.