How to print out a Datagrid

G

Guest

can someone provide me some codes that can print out a datagrid after i have
loaded the datagrid with records in a DataTable?
 
J

Jeff Louie

MJay... If all else fails you can print a datagrid from my printing
framework. I tried using just the datagrid without any other components
of my framework and it seems to work as a standalone workaround. The
following code snippets positions the datagrid at 100,100. The rectangle
is ignored.

private void printDocument1_PrintPage(object sender,
System.Drawing.Printing.PrintPageEventArgs e)
{
dataGrid1.Draw(null,100,100,e.Graphics,new RectangleF(0,0,0,0),false);
}

http://www.geocities.com/jeff_louie/windows_forms.htm

The headers only print if the datagrid has a valid TableStyle.

Regards,
Jeff
can someone provide me some codes that can print out a datagrid after i
have loaded the datagrid with records in a DataTable?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top