By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,959 Members | 1,139 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,959 IT Pros & Developers. It's quick & easy.

Printing Datagrid View

P: n/a
I am attempting to print a datagridview. I have not found any method
that works successfully. Has any one been successful with this?
Nov 23 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Here is a C# implementation,
http://www.dotnethorizon.com/Printin...idPrinter.html

Assistance in converting the code to VB can be provided by the C# to VB
converter at http://www.kamalpatel.net/

Only try to convert small bits of code at a time.

"ComputerStop" <Co**********@newsgroups.nospam> wrote in message
news:nq********************************@4ax.com...
I am attempting to print a datagridview. I have not found any method
that works successfully. Has any one been successful with this?

Nov 23 '05 #2

P: n/a
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

On Fri, 11 Nov 2005 02:01:08 GMT, "William LaMartin"
<la******@tampabay.rr.com> wrote:
Here is a C# implementation,
http://www.dotnethorizon.com/Printin...idPrinter.html

Assistance in converting the code to VB can be provided by the C# to VB
converter at http://www.kamalpatel.net/

Only try to convert small bits of code at a time.

"ComputerStop" <Co**********@newsgroups.nospam> wrote in message
news:nq********************************@4ax.com.. .
I am attempting to print a datagridview. I have not found any method
that works successfully. Has any one been successful with this?

Nov 23 '05 #3

P: n/a
"ComputerStop" <Co**********@newsgroups.nospam> wrote in message
news:nq********************************@4ax.com...
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
Nov 23 '05 #4

P: n/a
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.
"ComputerStop" <Co**********@newsgroups.nospam> wrote in message
news:r6********************************@4ax.com...
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

On Fri, 11 Nov 2005 02:01:08 GMT, "William LaMartin"
<la******@tampabay.rr.com> wrote:
Here is a C# implementation,
http://www.dotnethorizon.com/Printin...idPrinter.html

Assistance in converting the code to VB can be provided by the C# to VB
converter at http://www.kamalpatel.net/

Only try to convert small bits of code at a time.

"ComputerStop" <Co**********@newsgroups.nospam> wrote in message
news:nq********************************@4ax.com. ..
I am attempting to print a datagridview. I have not found any method
that works successfully. Has any one been successful with this?

Nov 23 '05 #5

P: n/a
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.

Nov 23 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.