Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > DataGrid printing tiny data
 

DataGrid printing tiny data

I have a datagrid I want to print and I got it to print using the code below from MSDN. Except that the data in the datagrid prints really really tiny you cant make it out at all and the hole section of data starts at the top of the page and is over the darkend top border of the grid and goes down 2 cells and over one.  Its reallly strange I dont know how to go about fixing this. 

Hope someone can help,  Thanks 

 

private void btnPrintGrid_Click(object sender, EventArgs e)

{

printDocument1.Print();

}

private void printDocument1_PrintPage(System.Object sender, System.Drawing.Printing.PrintPageEventArgs e)

{

PaintEventArgs myPaintArgs = new PaintEventArgs(e.Graphics, new Rectangle(new Point(0, 0), this.Size));

this.InvokePaint(DataGrid1, myPaintArgs);

}

CLProgrammer2  Wednesday, December 21, 2005 6:24 PM
Also, the data in the datagrid is added row by row in a loop so it does Not have a datasource, could this maybe be the problem ?
CLProgrammer2  Wednesday, December 21, 2005 7:50 PM

You can use google to search for other answers

Custom Search

More Threads

• problem saving data from datagirdview
• Change DataGridView Cell Type
• How to merge column in DataGridView ?
• How to set the properties of a remote desktop connection via a windows form
• Monitoring "Row" Events of a DataGridView
• delete datagridviewrows
• Data Grid view cell merging
• Paging Problem in Data Grid (Using Asp.Net with VB.Net)
• pasting images onto a control and saving it as bitmap
• Create calculated columns in datatable