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
Issue with UltraGrid (Windows) and printing.


We are trying to print the contents of an UltraGrid and have it look more-or-less like what the user sees, but it's not coming out right. Perhaps this has something to do with the way the columns are grouped? I've attached a couple pictures to show what I'm talking about. The first image is what the user sees, the second image is from a print preview. Does anybody know how I can make it look more like the first image?

Grid contents:

Print preview:

The code we have for the InitializePrintPreview event handler looks something like:

static void grid_InitializePrintPreview(object sender, CancelablePrintPreviewEventArgs e)
    e.DefaultLogicalPageLayoutInfo.FitWidthToPages = 1;
    e.PrintDocument.DefaultPageSettings.Margins = new Margins(5, 5, 5, 5);

Any help is greatly appreciated.