Search This Blog

Friday, January 4, 2013

Print RadGridView Telerik Windows Forms (VB.NET)

Telerik > Windows Forms > Print RadGridView

RadPrintDocument
Defines a reusable object that sends output to a printer and manages the whole printing process, when printing from an application

PrintPreviewDialog
Represents a dialog box form that contains a PrintPreviewControl for printing from a Windows Forms application.

AssociatedObject
 Gets or sets the object, associated with this document.

Print directly

Example:

Dim dialog As New PrintPreviewDialog
Dim RadPrintDocument1 As New RadPrintDocument
RadPrintDocument1.AssociatedObject = Me.RadGridView1
RadPrintDocument1.MiddleHeader = lblTitle.Text
RadPrintDocument1.MiddleFooter = "Page [Page #] of [Total Pages]"
RadPrintDocument1.RightFooter = "[Date Printed]"
dialog.Document = RadPrintDocument1
dialog.StartPosition = FormStartPosition.CenterScreen
dialog.ShowDialog()