我要打印的dataGridView
当我打印时,输出中缺少某些列
private void btnPrint_Click(object sender, EventArgs e)
{
int height = dataGridView1.Height;
// int width = dataGridView1.Width;
dataGridView1.Height = dataGridView1.RowCount * dataGridView1.RowTemplate.Height * 2;
map = new Bitmap(this.dataGridView1.Width,this.dataGridView1.Height);
dataGridView1.DrawToBitmap(map, new Rectangle(0,0,this.dataGridView1.Width, this.dataGridView1.Height));
dataGridView1.Height = height;
printPreviewDialog1.Document = printDocument1;
printPreviewDialog1.PrintPreviewControl.Zoom = 1;
printPreviewDialog1.ShowDialog();
}
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
e.Graphics.DrawImage(map,0, 0);
}