[COLOR="Gray"] private void Form1_Load(object sender, EventArgs e)
{[/COLOR]
System.Drawing.Printing.PrintDocument doc = new System.Drawing.Printing.PrintDocument();
doc.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(doc_PrintPage);
doc.Print();
[COLOR="Gray"] }[/COLOR]
void doc_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
DataGridView grd = [B][COLOR="Blue"]dataGridView1[/COLOR][/B];
Bitmap bmp = new Bitmap(grd.Width, grd.Height, grd.CreateGraphics());
grd.DrawToBitmap(bmp, new Rectangle(0, 0, grd.Width, grd.Height));
RectangleF bounds = e.PageSettings.PrintableArea;
float factor = ((float)bmp.Height / (float)bmp.Width);
e.Graphics.DrawImage(bmp, bounds.Left, bounds.Top, bounds.Width, factor * bounds.Width);
}