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
17259
Change the way UltraGridPrintDocument prints
posted

Hi,

I'm using the UltraGridPrintDocument to print my grid.

How do I:

1. Center the content in the page?

2. Remove the filter sign and the row selectors?

Thanks

  • 71886
    Offline posted

    Hello Amiram,

    As a possible approach you could hook onto the 'InitializePrintPreview' of the grid.

    Please review the following code sample:

    private void ultraGrid1_InitializePrintPreview(object sender, Infragistics.Win.UltraWinGrid.CancelablePrintPreviewEventArgs e)

    {

    e.PrintLayout.Override.RowSelectors = Infragistics.Win.DefaultableBoolean.False;

    e.PrintLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;

    e.PrintDocument.DefaultPageSettings.Margins = new System.Drawing.Printing.Margins(300, 300, 300, 300);

    }

    The tricky part here is that you would have to calculate the margins depending on the grid content.

    Please feel free to let me know if I misunderstood you or if you have any other questions.