Hello,
I am new to printing with the UltraGrid, UltraGridPrintDocument, etc... It's very easy to setup the basics, however I see that when printed, the entire grid is printed and occupies the entire page. Is it possible to simply print the rows and columns of the grid without any background or border stuff?
Thanks,
Matt
Hi,
I think Torrey's suggestion is the correct way to go - except that you probably don't want to set these properties on the Grid.DisplayLayout.Appearance, because that will affect the grid on the screen as well as the printed grid.
What you should do is using the InitializePrint or InitializePrintPreview event on the grid and use the Layout on the event args there. That way it only affects the printout and not the on-screen grid.
One way to get rid of the border is to set the BorderStyleCell property before printing, and then change it back afterwards. I'm not sure if this is the most efficient way since I haven't had to do this same exact thing, but it does work.
ultraGridPrintDocument1.FitWidthToPages = 1; ultraGrid1.DisplayLayout.Override.BorderStyleCell = UIElementBorderStyle.None; ultraPrintPreviewDialog1.ShowDialog(this); ultraGrid1.DisplayLayout.Override.BorderStyleCell = UIElementBorderStyle.Solid;
And if you're using an ISL file for styling, you'd can do it this way.
ultraGridPrintDocument1.FitWidthToPages = 1; ultraGrid1.StyleLibraryName = ""; ultraGrid1.DisplayLayout.Override.BorderStyleCell = UIElementBorderStyle.None; ultraPrintPreviewDialog1.ShowDialog(this); ultraGrid1.DisplayLayout.Override.BorderStyleCell = UIElementBorderStyle.Solid; ultraGrid1.StyleLibraryName = "YourStyleLibraryName";
If there's a better way, I'm sure the Infragistics Team will chime in.