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?
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; }
Thanks, Mike. I will give this a try.