private int GetNewIndexFromPageDown()
{
int i;
if (!this.VScroll)
{
// Not enough data to scroll, so go to the bottom row
i = this.RowCount - 1;
}
else
{
int currentRow = this.FocusedCell.Row;
int bottomRow = topIndex + vScrollBar.LargeChange - 2;
if (currentRow < bottomRow)
{
i = bottomRow;
}
else
{
i = Math.Min(this.RowCount - 1, currentRow - 2 + this.vScrollBar.LargeChange);
}
}
return i;
}