I'm trying to print directly from a datagrid and I'm running into some
problems. Heres a snipit of code I'm using for printing:
'************************************************* *******************
Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles btnPrint.Click
PrintDocument1.Print()
End Sub
'************************************************* *******************
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, _
ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles _
PrintDocument1.PrintPage
Dim myPaintArgs As New PaintEventArgs(e.Graphics, New Rectangle(New
_
Point(0, 0), myDataGrid.Size))
Me.InvokePaint(myDataGrid, myPaintArgs)
End Sub
'************************************************* *******************
This only prints the visible part of the grid and not all the data in
the table. The reason I'm printing directly from the Datagrid is
because some of my cells are wordwrapped - wordwrap works when I print
from datagrid because what you see is what you get.
Any ideas how to print the whole datagrid(with unseen rows), as well as
the column headers on every carry over page?
Thanks a lot.
Josh