While trying to retrieve the URL: http://www.codeproject.com/script/content/ajax/SniffCode.aspx?text=printing%20datagridview%0Aprivate%20StringFormat%20m_stringFormat%3B%0Aprivate%20double%20m_totalWidth%3B%0Aprivate%20int%20m_rowPos%3B%0Aprivate%20bool%20m_newPage%3B%0Aprivate%20int%20m_pageNo%3B%0Aprivate%20string%20m_pageHeader%20%3D%20%22Header%22%3B%0Aprivate%20string%20m_userName%20%3D%20%22Printed%20by%20%3Cusername%3E%22%3B%0Aprivate%20ArrayList%20m_columnLefts%20%3D%20new%20ArrayList()%3B%0Aprivate%20ArrayList%20m_columnWidths%20%3D%20new%20ArrayList()%3B%0Aprivate%20int%20m_pageHeight%20%3D%200%3B%0Aprivate%20int%20m_pageCount%20%3D%200%3B%0Aprivate%20void%20printDocument1_BeginPrint(object%20sender%2C%20System.Drawing.Printing.PrintEventArgs%20e)%0A%7B%0Am_stringFormat%20%3D%20new%20StringFormat()%3B%0Am_stringFormat.Alignment%20%3D%20StringAlignment.Near%3B%0Am_stringFormat.LineAlignment%20%3D%20StringAlignment.Center%3B%0Am_stringFormat.Trimming%20%3D%20StringTrimming.EllipsisCharacter%3B%0Am_totalWidth%20%3D%200%3B%0Aforeach%20(DataGridViewColumn%20oColumn%20in%20dataGridView1.Columns)%0A%7B%0Am_totalWidth%20%2B%3D%20oColumn.Width%3B%0A%7D%0Am_pageNo%20%3D%201%3B%0Am_newPage%20%3D%20true%3B%0Am_rowPos%20%3D%200%3B%0A%7D%0Aprivate%20void%20printDocument1_PrintPage(object%20sender%2C%20System.Drawing.Printing.PrintPageEventArgs%20e)%0A%7B%0Aint%20nWidth%2C%20i%3B%0Adouble%20nRowsPerPage%20%3D%200%3B%0Aint%20nTop%20%3D%20e.MarginBounds.Top%3B%0Aint%20nLeft%20%3D%20e.MarginBounds.Left%3B%0Aif%20(m_pageNo%20%3D%3D%201)%0A%7B%0Am_columnLefts.Clear()%3B%0Am_columnWidths.Clear()%3B%0Am_pageHeight%20%3D%200%3B%0Am_pageCount%20%3D%200%3B%0Aforeach%20(DataGridViewColumn%20oColumn%20in%20dataGridView1.Columns)%0A%7B%0Adouble%20floorVal%20%3D%20Convert.ToDouble(%20oColumn.Width%20)%20%2F%20m_totalWidth%20*%20m_totalWidth%20*%20(Convert.ToDouble(%20e.MarginBounds.Width)%20%2F%20m_totalWidth)%3B%0AnWidth%20%3D%20Convert.ToInt32(Math.Floor(floorVal))%3B%0Am_pageHeight%20%3D%20Convert.ToInt32(e.Graphics.MeasureString(oColumn.HeaderText%2C%20oColumn.
The following error was encountered:
Some aspect of the requested URL is incorrect. Possible problems:
Your cache administrator is root.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)