Feroz Khan

Feroz Khan

  • 1.4k
  • 300
  • 93.3k

how can i show some column from girdview to print preview

May 31 2016 6:19 AM
Please see below my code.. and find attached file. also.. 
 
private void MISPrintDocument_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
 
Bitmap bm = new Bitmap(this.datagridView2.Width, this.datagridView2.Height);
datagridView2.DrawToBitmap(bm, new System.Drawing.Rectangle(0, 0, this.datagridView2.Width, this.datagridView2.Height));
e.Graphics.DrawImage(bm, 0, 520);
 }
 
private void Print_Priview_btn_Click(object sender, EventArgs e)
{
MISPrintDocument.PrinterSettings.Copies = 1;
MISPrintPreviewDialog.Document = MISPrintDocument;
MISPrintPreviewDialog.ShowDialog();
}
 
 
 

Attachment: gridveiw.rar

Answers (1)