How to print Datagrid view in c#


How to print Datagrid view in c#

  • Open project
  • toolbox to select the print document on form
  • select one button place on the form
  • Print document goto event double click on print Page write code.

Bitmap bm = new Bitmap(this.dataGridView1.Width, this.Height);
dataGridView1.DrawToBitmap(bm, new Rectangle(0, 0, this.dataGridView1.Width, this.dataGridView1.Height));
e.Graphics.DrawImage(bm, 0, 0);

Goto buttonĀ  double click

printDocument1.Print();https://youtu.be/lU8yuTUyA2s

How to print Datagrid view in c#
How to print Datagridview in c#

Have any Question or Comment?

Leave a Reply

Your email address will not be published. Required fields are marked *

Categories

%d bloggers like this: