none
Print Button in Windows Forms c#

    Question

  • How do i program a button to print what ever is shown in a DataGridView? C#
    Tuesday, December 20, 2011 2:57 PM

Answers

  • Sorry mate doesnt help :/

    is there no code like: 

    "button1.click;

    datagridview.print();"

     

    HEEEELP 

    Thanks 


    Sam Mines

    Hi Sam Mines,

    I am sorry that the DataGridView has no print buttons/methods, you will need to implements it by yourself.

    Here is a sample code for you:

    The DataGridViewPrinter Class:
    http://www.codeproject.com/KB/printing/datagridviewprinter.aspx

     Best Regards


    Neddy Ren[MSFT]
    MSDN Community Support | Feedback to us
    • Proposed as answer by YosrJ Friday, December 23, 2011 1:28 PM
    • Marked as answer by Neddy Ren Monday, January 02, 2012 8:28 AM
    Thursday, December 22, 2011 8:20 AM

All replies

  • Hi, if you are using datatable as datasource you can read the following article.

    That article and componenet is written by me, so you cna ask me questions about it.

    http://www.codeproject.com/KB/cs/ExtendedDataTable.aspx

     

    Tuesday, December 20, 2011 3:11 PM
  • I am using a database in SQL. I am looking to print record off a phonebook i am creating. the dataGridView is set to show all the records i just need a code to print off that 

     

    Thanks

    Tuesday, December 20, 2011 4:07 PM
  • Try this

    Printing Sample



    If you find an answer helpful, click the helpful button. If you find an answer to your question, mark it as the answer.
    Tuesday, December 20, 2011 4:12 PM
  • Sorry mate doesnt help :/

    is there no code like: 

    "button1.click;

    datagridview.print();"

     

    HEEEELP 

    Thanks 


    Sam Mines
    Tuesday, December 20, 2011 4:15 PM
  • Sorry mate doesnt help :/

    is there no code like: 

    "button1.click;

    datagridview.print();"

     

    HEEEELP 

    Thanks 


    Sam Mines

    Hi Sam Mines,

    I am sorry that the DataGridView has no print buttons/methods, you will need to implements it by yourself.

    Here is a sample code for you:

    The DataGridViewPrinter Class:
    http://www.codeproject.com/KB/printing/datagridviewprinter.aspx

     Best Regards


    Neddy Ren[MSFT]
    MSDN Community Support | Feedback to us
    • Proposed as answer by YosrJ Friday, December 23, 2011 1:28 PM
    • Marked as answer by Neddy Ren Monday, January 02, 2012 8:28 AM
    Thursday, December 22, 2011 8:20 AM