bugs in GridPrintDocument

Dec 26, 2012 at 3:47 PM
GridPrintDocument is  greatefull way to print , however i found  a bug  : the cell and  the line  is drawed even is  hidden  , so if  you have  4 or five  columns  hidden , a big  line  wich is  the cumul of  four columns hidden, is prninted

so , i think a simple way to get rid of this :

in GridPrintDocument :

in function :
protected override void OnPrintPage(PrintPageEventArgs e)

change values to :

// Check if left border can be drawn in current page
							if ( ! ContainsInRange(rowHasLeftBorder, range.Start.Row, range.End.Row)
								&& cellRectangle.Left >= area.Left && colWidth > 0)
							{
								e.Graphics.DrawLine(m_BorderPen, cellRectangle.Left, clip.Top, cellRectangle.Left, clip.Bottom);
								AddRange(rowHasLeftBorder, range.Start.Row, range.End.Row);
							}
							// Check if top border can be drawn in current page
							if ( ! ContainsInRange(columnHasTopBorder, range.Start.Column, range.End.Column)
								&& cellRectangle.Top >= area.Top && colWidth > 0)
							{
								e.Graphics.DrawLine(m_BorderPen, clip.Left,	cellRectangle.Top, clip.Right, cellRectangle.Top);
								AddRange(columnHasTopBorder, range.Start.Column, range.End.Column);
							}
							// Check if right border can be drawn in current page
							if (cellRectangle.Right <= area.Right && colWidth > 0)
								e.Graphics.DrawLine(m_BorderPen, cellRectangle.Right, clip.Top, cellRectangle.Right, clip.Bottom);
							// Check if bottom border can be drawn in current page
							if (cellRectangle.Bottom <= area.Bottom && colWidth > 0)
								e.Graphics.DrawLine(m_BorderPen, clip.Left, cellRectangle.Bottom, clip.Right, cellRectangle.Bottom);