title: Printing of DataGridView in Winform C#
body: <p>I am trying to Printing Datagridview by making bitmap image , Its working nicely but it printing only in 1 page to print  . </p>
  
  <p><strong>Here is DataGirdView Image :</strong> </p>
  
  <p><a href="https://i.stack.imgur.com/qUnrK.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qUnrK.jpg" alt="enter image description here"></a></p>
  
  <p><strong>Print Preview Image</strong> :</p>
  
  <p><a href="https://i.stack.imgur.com/XSRBS.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XSRBS.jpg" alt="enter image description here"></a></p>
  
  <p>Here in print-Preview not having total rows to the last as of DataGridView row and only having 1 page </p>
  
  <p><strong>Code of Printing</strong> : </p>
  
  <pre><code> private void Btn_Print_Click(object sender, EventArgs e)
          {
              int height = DGV.Height;
              DGV.Height = DGV.RowCount * DGV.RowTemplate.Height * 2;
              bmp = new Bitmap(DGV.Width, DGV.Height);
              DGV.DrawToBitmap(bmp, new Rectangle(0, 0, DGV.Width, DGV.Height));
              DGV.Height = height;
              printPreviewDialog1.ShowDialog();       
  
          }
  
          private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
          {
              e.Graphics.DrawImage(bmp, 0, 0);
          }  
  </code></pre>
  
  <p>Why not printing data in more than 1 page ? Is there any wrong in code ? Please give suggestion </p>
  
  <p>Thank you . </p>