Asp.Net Hein

Asp.Net Hein

  • NA
  • 266
  • 167.3k

Print datagridview

Sep 22 2015 11:55 PM
When I print the datagridview in window application, I use PrintDialog and PrintDocument.
And then I use this code to print.
Bitmap bm = new Bitmap(this.dataGridView1.Width, this.dataGridView1.Height);  
dataGridView1.DrawToBitmap(bm, new Rectangle(0, 0, this.dataGridView1.Width, this.dataGridView1.Height));             
e.Graphics.DrawImage(bm, 0, 0);

This one only can print non-scrolled data. This cannot print if the gridview has many data. 
Can anybody help me in my problem???
Thanks a lot for viewing my question.
 

Answers (1)