Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 30th, 2009, 11:53 AM
bex bex is offline
Friend of Wrox
Join Date: Aug 2008
Posts: 154
Thanks: 7
Thanked 1 Time in 1 Post
Default Printing DataGridView in VB 2008


I am going round and round the DataGridView trying to print the Datat it contains.

I maneged to print the row Numbers, the string name, tru values , false values... but not what i need.
PrivateSub PrintDocument1_PrintPage(ByVal sender AsObject, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
' create a new font to print with...
Dim fnt AsNew Font("Arial", 10, FontStyle.Regular, GraphicsUnit.Point)
' print the text from the text box...
e.Graphics.DrawString(DataGridViewSearch.Rows.Count, fnt, Brushes.Black, 0, 0)
' end printing by indicating there are no more pages...
e.HasMorePages = False
as you can see here DataGridViewSearch.Rows.Count is printing the number of rows,

Is there another property that prints the data...

Or Can i disply the same data in RichTextBox,?

Last edited by bex; June 30th, 2009 at 12:09 PM..
Old June 30th, 2009, 02:57 PM
Lee Dumond's Avatar
Wrox Author
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts

Since this appears to be a Windows Forms question, you might get a quicker answer posting this question to a WinForms forum rather than an ASP.NET forum.
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

if (this.PostHelpedYou)

Similar Threads
Thread Thread Starter Forum Replies Last Post
Beginning VB 2008 mhccStudent Visual Basic 2008 Essentials 1 September 22nd, 2009 06:06 PM
VB.NET 2003 Appendix B convert to VB 2008 Express Edition brucechess BOOK: Beginning VB.NET Databases 10 February 5th, 2009 12:52 PM
Printing from VB 2008 BroadwayLion Visual Basic 2008 Essentials 1 September 27th, 2008 12:02 PM
why buy vs-2008 instead of vb-2008 jerryham VB.NET 7 September 2nd, 2008 02:39 PM
How do I write this vb 6 code to work in vb 2008? sanderson Visual Basic 2008 Essentials 3 June 10th, 2008 01:46 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.