Blue Theme Orange Theme Green Theme Red Theme
 
Home | Forums | Videos | Photos | Downloads | Blogs | E-Books | Interviews | Jobs | Beginners | Training
 | Consulting  
Submit an Article Submit a Blog 
 Login Close
User Id:
Password:
 
Forgot Password
Forgot Username
Why Register
 Jump to
Skip Navigation Links
TechnologyExpand Technology
WebsiteExpand Website
 Resources  
Close
 Our Network  
Close
Search :       Advanced Search »
Home » Printing » How To Print a Data Grid in C# and .NET

How To Print a Data Grid in C# and .NET

I wrote this article in response to the question, "How the heck do I print out a DataGrid and its contents

Author Rank:
Technologies: Printing,Visual C# .NET
Total downloads : 4691
Total page views :  177506
Rating :
 1.83/5
This article has been rated :  6 times
   Print Read/Post comments Post a comment  Rate  
   Email to a friend  Bookmark  Similar Articles  Author's other articles  
Download Files:
DataGridPrinterMG.zip
 
Become a Sponsor


Related EbooksTop Videos

The DataGrid is a highly versatile component of the .NET architecture and probably one of the most complex components. I wrote this article in response to the question, "How the heck do I print out a DataGrid and its contents".  My first off the cuff suggestion was to capture the form using my screen capture article, but this of course does not solve the problem of printing out the umpteen rows being virtually displayed in the DataGrid.  Then I thought to myself, this should be easy,  I'll just use GDI+ and go through the rows in the DataGrid and print out its contents.  Well the DataGrid is a bit more complex than that because it does not contain the data within itself.  The data is contained within the DataSet.  So the approach I settled on was to capture the color and font properties from the DataGrid for the print out, and the capture the information in the rows from the DataSet.  In order to encapsulate the drawing of the DataGridPrinter to the Printer, I created the DataGridPrinter class shown in Figure 2 below.  This class takes a DataGrid, a PrintDocument, and a DataTable passed to its constructor and utilizes these objects to draw the DataGrid to the printer.

Figure 1. The Print Preview of the Northwind DataGrid

Figure 2. DataGridPrinter Class UML Design (Reverse engineered using WithClass 2000)

The DataGridPrinter is constructed in the constructor of the form so it can be utilized by all of the printing functions (print, print preview, etc.)  Below is the code for constructing the DataGridPrinter:

void SetupGridPrinter()
{
dataGridPrinter1 =
new DataGridPrinter(dataGrid1, printDocument1,
dataSet11.Customers);
}

Once the DataGridPrinter is constructed, you can have it draw the DataGrid to the printer by calling its DrawDataGrid method in the Print Page event handler:

private void printDocument1_PrintPage(object sender,System.Drawing.Printing.PrintPageEventArgs e)
{
Graphics g = e.Graphics;
// Draw a label title for the grid
DrawTopLabel(g);
// draw the datagrid using the DrawDataGrid method passing the Graphics surface
bool more = dataGridPrinter1.DrawDataGrid(g);
// if there are more pages, set the flag to cause the form to trigger another print
page event
if (more == true)
{
e.HasMorePages =
true;
dataGridPrinter1.PageNumber++;
}
}

The PrintPage event is triggered by both the Print method in the PrintDocument and the PrintPreviewDialog's ShowDialog method.  Below is the form's method for printing the DataGrid to the printer:

private void PrintMenu_Click(object sender, System.EventArgs e)
{
// Initialize the datagrid page and row properties
dataGridPrinter1.PageNumber = 1;
dataGridPrinter1.RowCount = 0;
// Show the Print Dialog to set properties and print the document after ok is pressed.
if (printDialog1.ShowDialog() == DialogResult.OK)
{
printDocument1.Print();
}
}

Now let's take a look at the internals of the DataGridPrinter methods. There are two main methods in the DataGridPrinter class that do all the drawing: DrawHeader and DrawRows. Both these methods extract information from the DataGrid and the DataTable to draw the DataGrid. Below is the method for drawing the rows of the DataGrid:

public bool DrawRows(Graphics g)
{
try
{
int lastRowBottom = TopMargin;
// Create an array to save the horizontal positions for drawing horizontal gridlines
ArrayList Lines = new ArrayList();
// form brushes based on the color properties of the DataGrid
// These brushes will be used to draw the grid borders and cells
SolidBrush ForeBrush = new SolidBrush(TheDataGrid.ForeColor);
SolidBrush BackBrush =
new SolidBrush(TheDataGrid.BackColor);
SolidBrush AlternatingBackBrush =
new SolidBrush
TheDataGrid.AlternatingBackColor);
Pen TheLinePen =
new Pen(TheDataGrid.GridLineColor, 1);
// Create a format for the cell so that the string in the cell is cut off at the end of
the column width
StringFormat cellformat = new StringFormat();
cellformat.Trimming = StringTrimming.EllipsisCharacter;
cellformat.FormatFlags = StringFormatFlags.NoWrap | StringFormatFlags.LineLimit;
// calculate the column width based on the width of the printed page and the # of
columns in the DataTable
// Note: Column Widths can be made variable in a future program by playing with
the GridColumnStyles of the
// DataGrid
int columnwidth = PageWidth/TheTable.Columns.Count;
// set the initial row count, this will start at 0 for the first page, and be a different
value for the 2nd, 3rd, 4th, etc.
// pages.
int initialRowCount = RowCount;
RectangleF RowBounds =
new RectangleF(0, 0, 0, 0);
// draw the rows of the table
for (int i = initialRowCount; i < TheTable.Rows.Count; i++)
{
// get the next DataRow in the DataTable
DataRow dr = TheTable.Rows[i];
int startxposition = TheDataGrid.Location.X;
// Calculate the row boundary based on teh RowCount and offsets into the page
RowBounds.X = TheDataGrid.Location.X;RowBounds.Y = TheDataGrid.Location.Y +
TopMargin + ((RowCount - initialRowCount)+1) * (TheDataGrid.Font.SizeInPoints +
kVerticalCellLeeway);
RowBounds.Height = TheDataGrid.Font.SizeInPoints + kVerticalCellLeeway;
RowBounds.Width = PageWidth;
// save the vertical row positions for drawing grid lines
Lines.Add(RowBounds.Bottom);
// paint rows differently for alternate row colors
if (i%2 == 0)
{
g.FillRectangle(BackBrush, RowBounds);
}
else
{
g.FillRectangle(AlternatingBackBrush, RowBounds);
}
// Go through each column in the row and draw the information from the
DataRow
for (int j = 0; j < TheTable.Columns.Count; j++)
{
RectangleF cellbounds =
new RectangleF(startxposition,
TheDataGrid.Location.Y + TopMargin + ((RowCount - initialRowCount) + 1) *
(TheDataGrid.Font.SizeInPoints + kVerticalCellLeeway),
columnwidth,
TheDataGrid.Font.SizeInPoints + kVerticalCellLeeway);
/ draw the data at the next position in the row
if (startxposition + columnwidth <= PageWidth)
{
g.DrawString(dr[j].ToString(), TheDataGrid.Font, ForeBrush, cellbounds,cellformat);
lastRowBottom = (
int)cellbounds.Bottom;
}
// increment the column position
startxposition = startxposition + columnwidth;
}
RowCount++;
// when we've reached the bottom of the page, draw the horizontal and vertical
grid lines and return true
if (RowCount * (TheDataGrid.Font.SizeInPoints + kVerticalCellLeeway) >
PageHeight * PageNumber) -
(BottomMargin+TopMargin))
{
DrawHorizontalLines(g, Lines);DrawVerticalGridLines(g, TheLinePen, columnwidth,
lastRowBottom);
return true;
}
}
// when we've reached the end of the table, draw the horizontal and vertical grid
lines and return false
DrawHorizontalLines(g, Lines);
DrawVerticalGridLines(g, TheLinePen, columnwidth, lastRowBottom);
return false;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
return false;
}
}

The method goes through each row in the DataTable and draws the data. The method uses the properties of the DataGrid to paint each row with the appropriate colors and draw each string with the DataGrid's font. If the method reaches the bottom of the page, it breaks and returns true so that the rest of the DataGrid can be printed on the following page.

Improvements:

This class can be greatly improved by utilizing the DataGridColumnStyle class stored in the TableStyles property of the DataGrid. These properties allow you to specify different column width's for certain columns and different text alignments.


Login to add your contents and source code to this article
 [Top] Rate this article
 About the author
 
Mike Gold
Michael Gold is President of Microgold Software Inc., makers of the WithClass UML Tool. His company is a Microsoft VBA Partner and Borland Partner. Mike is a Microsoft MVP and founding member of C# Corner. He has a BSEE and MEng EE from Cornell University and has consulted for Chase Manhattan Bank, JP Morgan, Merrill Lynch, and Charles Schwab. Currently he is a senior developer at Finisar Corp. He has been involved in several .NET book projects, and is currently working on a book for using .NET with embedded systems. He can be reached at mike@c-sharpcorner.com
Looking for C# Consulting?
C# Consulting is founded in 2002 by the founders of C# Corner. Unlike a traditional consulting company, our consultants are well-known experts in .NET and many of them are MVPs, authors, and trainers. We specialize in Microsoft .NET development and utilize Agile Development and Extreme Programming practices to provide fast pace quick turnaround results. Our software development model is a mix of Agile Development, traditional SDLC, and Waterfall models.
Click here to learn more about C# Consulting.
 
Introducing MaxV - one click. infinite control. Hyper-V Hosting from MaximumASP.
Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Dynamic PDF
ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
Go.NET
Build custom interactive diagrams, network, workflow editors, flowcharts, or software design tools. Includes many predefined kinds of nodes, links, and basic shapes. Supports layers, scrolling, zooming, selection, drag-and-drop, clipboard, in-place editing, tooltips, grids, printing, overview window, palette. 100% implemented in C# as a managed .NET Control. Document/View/Tool architecture with many properties&events. Optional automatic layout.
Dundas Software
Dundas Chart for .NET is the most advanced .NET charting package available today.  With an extremely complete feature set, elegant architecture and easy implementation, Dundas Chart can quickly add advanced Charting functionality to enhance and transform ASP.NET and Windows Forms applications.  Whether you are implementing charting into internal projects, or building applications for clients, Dundas Chart offers advanced technology and advanced results to get the most out of data.
Clickatell's SMS Gateway
Clickatell's Developer Solutions allow you to SMS enable any website or application via a range of API's. Learn More about our API connections.
Free access to .NET Memory Management video
Everything you need to know about Garbage Collection, Temporary Objects, Fragmentation, Finalization and common causes of memory leaks in .NET. Watch the video here.
Microsoft Visual Studio 2010
Microsoft Visual Studio 2010 offers more to developers than any other Visual Studio release. Work more productively and collaboratively-with greater control over your work at every step. The Beta 2 can give you a head start on achieving efficiency.
 
   Print Read/Post comments Post a comment  Rate  
   Email to a friend  Bookmark  Similar Articles  Author's other articles  
Download Files:
DataGridPrinterMG.zip
 
 Post a Feedback, Comment, or Question about this article
Subject:  
Comment:  
Become a Sponsor
 Comments
Print Data Grid View by jayshukla On March 27, 2006

Hi Mike,

I wanted to thank you for such a great sample. I was wondering if you have a version that allows printing the Data Grid View (VS.NET 2005), Appreicate if you could give any ideas or any alternatives that I could follow.

Thanks

JS

Reply | Email | Delete | Modify | 
Resizing a cell - won't get printed out... by Sibi On March 16, 2007
Hello, great article Mike! but one problem i got: If i resize one cell and then print, it still shows the Datagrid without the resized cell/Row/Column. What iam doing wrong? Thanks! Sibi
Reply | Email | Delete | Modify | 
Re: Resizing a cell - won't get printed out... by vamsi On March 18, 2007

u can use this code which creates excel sheet n then prints

add the necessary dll's microsoft.excel11.5..

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
//using Microsoft.VisualStudio.Tools.Applications.Runtime;
using System.Reflection;
using Excel;
using Microsoft.VisualBasic;
using Microsoft.Office;

//using System;
//using System.Drawing;
//using System.Drawing.Printing;
//using System.Text;
//using System.Web;
//using System.IO;

public partial class WebPrintingPage : System.Web.UI.Page
{
    protected System.Web.UI.HtmlControls.HtmlInputFile File1;
    protected void Page_Load(object sender, EventArgs e)
    {

    }

 

    protected void Submit_Click(object sender, EventArgs e)
    {

        string strPath = Server.MapPath(@ConfigurationManager.AppSettings["ExcelPath"]);
        //sInputFile = sInputFile.Substring(sInputFile.LastIndexOf(@"\") + 1);
        string sTempFile = Server.MapPath("ExcelTest.xls");
        /*Start Ticket# 450173 */
        object oMissing = System.Reflection.Missing.Value;
        /*End Ticket# 450173 */

        //if (File1.PostedFile != null)
        //{
        //try
        //{
            ////if re-run, delete the previous version
            //if (File.Exists(sTempFile))
            //    File.Delete(sTempFile);

            //File1.PostedFile.SaveAs(sTempFile);

            //if (!readOnly())
            //    return;


            //OnBatchBegin();
            /*Start Ticket# 450173 */
            // Create an instance of Microsoft Excel, make it visible,
            // and open Book1.xls.
            Excel.Application oExcel = new Excel.Application();
            //oExcel.Visible = true;
            oExcel.DisplayAlerts = false;
            Excel.Workbooks oBooks = oExcel.Workbooks;
            Excel._Workbook oBook = null;
            Excel._Worksheet sheet = null;

            oBook = oBooks.Open(sTempFile,
                0, true, 5, "", "", true, Excel.XlPlatform.xlWindows, "\t", false,
                false, 0, true, true, true);

          
        //Function Open([UpdateLinks], [ReadOnly], [Format], [Password], [WriteResPassword], [IgnoreReadOnlyRecommended], [Origin], [Delimiter], [Editable], [Notify], [Converter], [AddToMenuRecentlyUsed]) As Workbook

            // Get a reference to the one and only worksheet in our workbook
            sheet = (Excel._Worksheet)oBook.ActiveSheet;
            sheet.PrintOut(1, Type.Missing, 1, false, Type.Missing, false, false, Type.Missing);

//            sheet.PrintOut(1, 2, 1, false, Type.Missing, true, false, sTempFile);
   

           
            //int row;
            //int col = 0;

            //        /*col_name is the array which contains the name of all the columns of the excel
            //            * In case of more columns being used in the excel - Add the column here*/
            //        string[] col_name = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "AA", "AB", "AC", "AD", "AE", "AF", "AG", "AH", "AI" };

            //        System.Data.DataTable dt = new System.Data.DataTable();
            //        DataSet dsExcel = new DataSet();

            //        /*Add the columns to the data table which should be the same no as in the array above*/
            //        while (col < col_name.Length)
            //        {
            //            dt.Columns.Add();
            //            col++;
            //        }

            //        int iflag = 1;
            //        for (row = 6; row < 62000; row++)
            //        {
            //            if (iflag == 1)
            //            {
            //                iflag = 0;
            //                System.Data.DataRow dr = dt.NewRow();
            //                for (col = 0; col < 35; col++)
            //                {
            //                    string xlValue = ""; //this field temporarily stores the cell data of excel

            //                    /* Have put the try-catch block as it throws exception if the cell is empty*/
            //                    try
            //                    {
            //                        xlValue = sheet.get_Range(col_name[col] + row.ToString(), col_name[col] + row.ToString()).Cells.Value2.ToString();
            //                    }
            //                    catch (Exception ex)
            //                    {
            //                        /*Do not put any thing in this catch block*/
            //                    }

            //                    dr[col] = xlValue;

            //                    /* Checking if all the columns are empty then set the flag to 0 and exit the loop*/
            //                    if (xlValue.Trim() != "")
            //                    {
            //                        iflag = 1;
            //                    }


            //                }//End of inner for loop
            //                dt.Rows.Add(dr);
            //            }//End of iflag if block
            //            else
            //            {
            //                break;//exit the loop if for a row, all the columns are empty
            //            }

            //        } //End of the outer for loop

            //        /*Add the data table to the dataset for further processing*/
            //        dsExcel.Tables.Add(dt);


            //        // Quit Excel and clean up.
            //        //     System.Runtime.InteropServices.Marshal.ReleaseComObject (sheet);
            //        //     sheet = null;
            //        //     oBook.Close(false, oMissing, oMissing);
            //        //     System.Runtime.InteropServices.Marshal.ReleaseComObject (oBook);
            //        //     oBook = null;
            //        //     oBooks.Close();
            //        //     System.Runtime.InteropServices.Marshal.ReleaseComObject (oBooks);
            //        //     oBooks = null;
            //        //     oExcel.Quit();
            //        //     System.Runtime.InteropServices.Marshal.ReleaseComObject (oExcel);
            //        //     oExcel = null;
            if (sheet != null)
            {
                //sheet.Delete();
                oBook.Close(null, null, null);
                oBooks.Close();
                oExcel.Workbooks.Close();
                oExcel.Quit();

            }
            if (sheet != null)
                System.Runtime.InteropServices.Marshal.ReleaseComObject(sheet);
            if (oBook != null)
                System.Runtime.InteropServices.Marshal.ReleaseComObject(oBook);
            if (oBooks != null)
                System.Runtime.InteropServices.Marshal.ReleaseComObject(oBooks);
            if (oExcel != null)
                System.Runtime.InteropServices.Marshal.ReleaseComObject(oExcel);
            sheet = null;
            oBook = null;
            oBooks = null;
            oExcel = null;

            GC.Collect();

            //        for (int intCounter = 0; intCounter < dsExcel.Tables[0].Rows.Count; intCounter++)
            //        {/*End Ticket# 450173 */
            //            icntParm = 0;
            //            parmNames[icntParm] = "@Transaction_Key";
            //            string transKey = DateTime.Now.Month.ToString()
            //                + DateTime.Now.Day.ToString()
            //                + DateTime.Now.Year.ToString()
            //                + DateTime.Now.Hour.ToString()
            //                + DateTime.Now.Minute.ToString() + iloadLines.ToString();

            //            parmValues[icntParm] = transKey;

            //            foreach (ImportRecord.Field field in m_ImportRecord.m_Sections[0].m_Items)
            //            {
            //                icntParm++;
            //                /*Start Ticket# 450173 */
            //                //string m_value= getValue (ref dsExcel, field.Cell);
            //                string m_value = dsExcel.Tables[0].Rows[intCounter][field.Cell].ToString();
            //                /*End Ticket# 450173 */

            //                if (field.Length != 0)
            //                    m_value = RecoveryBusiness.appendZero(m_value, field.Length);

            //                parmNames[icntParm] = "@" + field.Name;
            //                parmValues[icntParm] = m_value.ToUpper();
            //                if (field.Name == "Recovery_Amount")
            //                    dbtotalAmount = dbtotalAmount + (m_value != "" ? Double.Parse(parmValues[icntParm]) : 0);
            //            }
            //            iloadLines++;
            //            if (!EndOfRecords(parmValues, parmNames))
            //            {
            //                m_Business.CurrentRecovery.LoadTmesys(parmValues, parmNames);
            //                iXLrec++;
            //            }
            //            else
            //                break;
            //        }

            //        if (iXLrec > 0)
            //        {
            //            this.txtBatchNumber.Text = m_Business.CurrentRecovery.TmesysFileInfoInsert(sInputFile, txtCheckDepositDate.Text, User.ExtendedIdentity.Login);

            //            //validate records
            //            DataView dvErrors = RecoveryBusiness.ValidateTmesysRecords();
            //            this.lblBatchStats.Text = "Recoveries received: " + (iloadLines - 1) + "<br>Total file amount: " + String.Format("{0:c}", dbtotalAmount);
            //            if (dvErrors.Count == 0)
            //            {
            //                this.btnAcceptFile.Enabled = true;
            //                this.lblMsg.Text = "Succeseful load. You can accept the file into the RPS database.";
            //                EnableErrorsGrid(false);
            //            }
            //            else
            //            {
            //                this.lblMsg.Text = "File has errors. Fix the errors and re-load the file.";
            //                showTmesysErrors(dvErrors);
            //            }
            //        }
            //        else
            //        {
            //            this.lblMsg.Text = "There is no data to load in specified file.";
            //        }
            //    }
            //    catch (Exception ex)
            //    {
            //        //Debug.WriteLine( "Error in btnLoadExcel_Click " + ex.Message + " Claim Number:" + parmValues[6]+ parmValues[8] );
            //        lblMsg.Text = "Error Loading Excel: " + Environment.NewLine + ex.Message;
            //    }
            //    finally
            //    {

            //        conn.Close();

            //        File.Delete(sTempFile);
            //    }
            ////}
        }
    }

 

regards

chandu

 

Reply | Email | Delete | Modify | 
Re: Re: Resizing a cell - won't get printed out... by Sibi On March 21, 2007

Hello, well thanks for the Excel code. But not every user has Excel installed. Is there a solution without Excel?

Thanks,

Sibi

Reply | Email | Delete | Modify | 
Re: Re: Re: Resizing a cell - won't get printed out... by Mike On March 21, 2007

Check out a more recent article on printing the DataGridView:

 

http://www.c-sharpcorner.com/UploadFile/mgold/ExerciseTracker02272006010240AM/ExerciseTracker.aspx

 

 

Reply | Email | Delete | Modify | 
its good and help full by sanjeev On April 18, 2007

Hi Mike,

 Thanks for such a great article, and I want to know about RenderControl here I am using this controls to print grid info... but after render its returning null value.... to calling function.... I am calling from Print function.... print.value=strPrint passing null value.... so please let me know how to work on this rendercontrols...

i.e in print function.....

private void btnPrint_ServerClick(object sender, System.EventArgs e)

{

string strPrint=GetHtml(theGrid) //then GetHtml function is calling

strPrint=strPrint.Replace("\r","");

strPrint=strPrint.Replace("\t","");

strPrint=strPrint.Replace("\n","");

Print.Value =strPrint; // this document to get print

isComplete.Value="1";

}

string GetHtml(Control c)

{

 StringWriter sw = new StringWriter();

 HtmlTextWriter hw = new HtmlTextWriter(sw);

 c.RenderControl(hw); return sw.ToString();

 }

Thanks & Regards,

Sanjay

Reply | Email | Delete | Modify | 
Print a Gridview in ASP.NET by SWL On April 23, 2007
Hi Mike, I read several of your articles regarding datagrid print. They are great! But I assume they are for WinForms. Do you have a version that allows printing the GridView in ASP.NET (web-based)? Thanks! SWL
Reply | Email | Delete | Modify | 
print datagrid by jerome On July 5, 2007
Hi Mike, I have a datagrid(printgrid) and button(print).please send the solution for when i click on the button to get the printout of datagrid items thanks jerome
Reply | Email | Delete | Modify | 
thanks by pedram On September 2, 2007
mr gold.i love u& your code.
Reply | Email | Delete | Modify | 
Re: thanks by arvind On January 8, 2008

To become expert in visual C#.net ,how much i should know about ADO.net.

my email_id is: arvinddhar2007@hotmail.com

Reply | Email | Delete | Modify | 
how to print Dataset table through coding pls my id: karnasivagiri@yahoo.co.in by karuna On December 20, 2007
i am developping one application software. i want to print the dataset tables report.
Reply | Email | Delete | Modify | 
The Data Lost by tianya On January 14, 2008
when I use it,I have 140 datarows. last page is 70 but next page begins 73. 71and 72 lost.
Reply | Email | Delete | Modify | 
Thank by saeid On January 26, 2008
I am iranian. my name is SAEID and thanks for programs. bye bye
Reply | Email | Delete | Modify | 
Print Data Grid in windows application by Shadab On March 24, 2008

Hi, I am shadab from India. I unable to Print Data Grid in window form.

Plz tell me How to print Data Grid in window form...........

Reply | Email | Delete | Modify | 
Thanks by Hasitha Indunil On September 24, 2008
Hi, I could overcome the my task using this. Hasitha
Reply | Email | Delete | Modify | 
Print by cam On February 16, 2009
Thanks
Reply | Email | Delete | Modify | 
Thanks by Ana On March 27, 2009
Hi Mike, Thank you for this great example. Just the one I needed, because I was trying to do the same thing and I couldn't do it rigth. Thank you for sharing your knowlegde with the rest of the people, who are learning too, like me. Thanks again, AnMatrix
Reply | Email | Delete | Modify | 
Trouble with row height by Greg On August 25, 2009
Great Article! It is very helpful. I am working with DataGridView and I am able to get it to display, but my data needs to be displayed in Landscape form and my rows and columns need wraparound and I guess be wider. Can this be done?
Reply | Email | Delete | Modify | 
Database by Tushar On September 24, 2009
Hello Sir can u please give me the database file(NorthWind.mdb) of this code urgent
Reply | Email | Delete | Modify | 

 Hosted by MaximumASP  |  Found a broken link?  |  Contact Us  |  Terms & conditions  |  Privacy Policy  |  Site Map  |  Suggest an Idea  |  Media Kit
Current Version: 5.2009.6.2
 © 1999 - 2009  Mindcracker LLC. All Rights Reserved