Hello,
I am printing grid content using the UltraGridPrintDocument. This works as expected, except setting CellPadding seems to be ignored when printing.
I am setting CellPadding to zero in both AfterInitializeLayout and in InitializePrint. It works on the screen but not in the output.
Any way to get this to work?
Thanks,
Trausti
Hi Trausti,
With a value of 0, how can you tell it's not working? 0 padding is pretty close to the default, so this would be a pretty subtle difference.
I tried this out using a CellPadding of 10, just so it's plainly obvious whether the padding is being printed or not and it works just fine for me. I have attached my sample here so you can try it out.
Thanks Mike. Yes, you are right, I was expecting something from this property that does not apply.
On screen, I have very little space (which I thought was controlled by the padding) inside of the cells, but in the printout, this appears to be increased. It turns out that when the grid's TextRenderingMode is set to GDI, I get this discrepancy. When I change it to GDI+, the print out matches the grid on the screen.
GDI+ results in taller rows (has space that looks like padding). In the end, I am just trying to reduce the row height in the printout.
I don't see any reason why the TextRenderingMode should change while printing. If you are using GDI on the screen, then the grid will use GDI when printing, too.
Maybe you are auto-sizing the row heights or changing them somehow on the print layout.