Trouble Printing Datagrids from the Print Preview Window

May 4 2004 2:34 PM
I've got a C# Winforms app and I'm trying to print a datagrid using the technique found here: http://www.c-sharpcorner.com/Graphics/DataGridPrinterMG.asp So far the print functionality is working great, if we call it directly and the user clicks "Print" from the PrintDialog. The problem starts with the print preview. The grid is displayed fine in the preview window, but when the user prints from the PrintPreviewDialog by clicking the "Print" button, only the header row is printed out. This is really puzzling because if the grid is getting to the PrintPreviewDialog okay, it should print just fine because the print is a method of the PrintPreviewDialog, not my own code. Has anyone else experienced this problem? I could post the code, but there's a lot of it and it follows the article explicitly. Thanks in advance for your help!

Answers (1)