int GetGridlineYMax(PaintEventArgs e)
{
int rightOfLastCol = this.ColumnModel.ColumnHeaderRect(this.ColumnCount - 1).Right;
int right;
if (this.GridLinesContrainedToData && (e.ClipRectangle.Right > rightOfLastCol))
{
right = rightOfLastCol;
}
else
{
right = e.ClipRectangle.Right;
}
return right;
}