How to print directly from a UltraGrid (infragistic controls) in

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am having trouble printing in landscape, when i print directly from the grid.

This is how my code looks rightnow:


Private Sub cmdPrintFromGrid_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles cmdPrintFromGrid.Click


Dim prtDoc As New Printing.PrintDocument()
prtDoc.DefaultPageSettings.Landscape = True
Me.UltraGrid1.Print(Me.UltraGrid1.DisplayLayout, prtDoc)


End Sub


Private Sub UltraGrid1_InitializePrint(ByVal sender As Object, ByVal e As
Infragistics.Win.UltraWinGrid.CancelablePrintEventArgs) Handles
UltraGrid1.InitializePrint

e.DefaultLogicalPageLayoutInfo.FitWidthToPages = 1

End Sub




I get printed two pages all the time. In one page I have the contents of
the grid (what i want) and in the other page I get the two last colums, but
they where already in the first page. something strange.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top