Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have many forms with data grid view and I have print button in my forms that print from data grid view I download one class print.DVG from internet and write

C#
private void Print_Click(object sender, EventArgs e)//print
{
   PrintDGV.Print_DataGridView(dataGridViewX1);
}

and I build one form printoptions but this error appereance
object reference not set to an instance of an object
Posted
Updated 9-Aug-11 22:39pm
v2

Have a look at this: Another DataGridView Printer[^]

It's recent, seems to work, and you can contact the author directly by using the "New Message" at the bottom of the page if you have problems.
 
Share this answer
 
Going by the code you have posted, PrintDGV seems to be null. Or something inside Print_DataGridView method is null.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900