|
-
Aug 24th, 2007, 04:48 PM
#1
Thread Starter
New Member
Datagridview print graphics
I used to use VS2003 and the DataGrid control. Now I have been using the VS 2005 DataGridView control (I don't even see the old DataGrid in the toolbox).
I accomplished printing a DataGrid as a Graphic (not text) with
public DataGrid gridtoprint = new DataGrid();
(blah, blah, other stuff to fill the grid)
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( gridtoprint, myPaintArgs );
}
But try this after simple substitution of:
public DataGridView gridtoprint = new DataGridView();
and some really weird things happen. Yes, the grid prints. But the elements are not in the cells. Instead, they are all packed into the top left corner of the grid in about 0.05 point type.
Is there a simple solution that allows my continued use of the new DataGridView control or do I need to go back to DataGrids for this functionality??
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|