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
135
UltraGridPrintDocument page breaks go across columns
posted

I am using UltraGridPrintDocument to print the contents of an UltraGrid.  If the grid is too wide to fit on one page, then the document prints more than one page.  If the edge of a page falls in the middle of a column, then the column spans two pages.  This is not the behavior I want.  I want the grid to print in a way similar to that of MS Excel, where a column is printed on the next page if there is not enough room for the entire column.  How would I accomplish this?

  • 469350
    Verified Answer
    Offline posted

    There's no way to prevent part of the column from displaying on the first page, but you can make the grid repeat the entire column on the next page.

    You would do this in the InitializePrint or the InitializePrintPreview event of the grid (depending on whether or not you are showing a preview).


            private void ultraGrid1_InitializePrintPreview(object sender, CancelablePrintPreviewEventArgs e)
            {
                e.DefaultLogicalPageLayoutInfo.ColumnClipMode = ColumnClipMode.RepeatClippedColumns;
            }