Printing Datagrid View

  • Thread starter Thread starter ComputerStop
  • Start date Start date
C

ComputerStop

I am attempting to print a datagridview. I have not found any method
that works successfully. Has any one been successful with this?
 
Thanks William,

I have found several examples of printing a datagrid but in 2005 they
have the datagrid view and what worked with the datagrid does not seem
to work with the datagridview.

Randy
 
ComputerStop said:
I am attempting to print a datagridview. I have not found any method
that works successfully. Has any one been successful with this?

Moderately. I coded it myself, using the PrintPreview control, and "drawing"
in the paint event. Tedious, but satisfying. You can also buy 3rd party
controls.

---MikeB
 
Not having seen VS 2005, I am not familiar with the datagridview. However,
if you look at the code for printing a datagrid that I reference, it really
uses nothing about the datagrid other than the data that it holds as best I
can tell on a quick look. So this should be adaptable to whatever the
datagrid view is if it is just a vehicle to display data ion table form.
 
Hi Randy,

Yes, there is no build-in way to print the content of DataGridView, which
is the same as DataGrid(there is no build-in way to print DataGrid content
either). We still have to loop through all the row content of the
datasource and query corresponding DataGridView column/row style
information to do the customized printing, which really requires some work.

The link "William LaMartin" provided has showed us a good example of do the
customize printing. You can leverage the similiar idea and modify it to
DataGridView version, but I suspect this may need many modificaitons.

Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

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

Back
Top