Datagridview print
how to print data from datagridview after click on print button in a simple form
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Abhay ShankerRank #375 · 6.7K reputationPosted Jul 17, 2014, 7:38 PM EDT
private void button2_Click(object sender, EventArgs e)
{
printDocument1.Print();
}
private void printDocument1_PrintPage(object sender,
System.Drawing.Printing.PrintPageEventArgs e)
{
PaintEventArgs myPaintArgs = new PaintEventArgs(e.Graphics,
new Rectangle(new Point(0, 0), this.Size));
this.InvokePaint(dataGridView1, myPaintArgs);
}
Abhay ShankerRank #375 · 6.7K reputationPosted Jul 17, 2014, 7:39 PM EDT
http://www.codeproject.com/Articles/43569/Printing-a-datagridview-in-C-NET
http://www.mindstick.com/Articles/2ea844ec-2b41-4a86-b931-fcbc6e4fb6c2/?Datagridview%20Printing%20in%20C
http://jeremycomer.com/blog/?p=64