Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
705
UltraGrid - PrintPreview not printing background colour
posted

Hi, I need the printpreview to reproduce the view of the ultragrid exactly as it is, background colours and all. How can I achieve this? I read in a very old post that it wasn't possible but wanted to know if that's still the case. Attached is an image of my grid and the result of PrintPreview. Thank you.

    Public Sub Print_grid(ByVal xGrid As Infragistics.Win.UltraWinGrid.UltraGrid)
        Try
            If xGrid.Rows.Count = 0 Then Exit Sub
            Dim doc As New System.Drawing.Printing.PrintDocument
            Dim Marg As New System.Drawing.Printing.Margins

            Marg.Left = 0
            Marg.Right = 0
            Marg.Top = 0
            Marg.Bottom = 30

            doc.DefaultPageSettings.Margins = Marg
            doc.DefaultPageSettings.Landscape = True

            xGrid.PrintPreview(xGrid.DisplayLayout, doc)

        Catch ex As Exception
            MsgBox(ex.Message & " // Print_grid // " & xGrid.FindForm.Name & "." & xGrid.Name)
        End Try

    End Sub

Parents Reply Children