public int GetFirstRow(int lastPageRow)
{
int pageHeight = _treeView.DisplayRectangle.Height - _treeView.ColumnHeaderHeight;
int y = 0;
for (int i = lastPageRow; i >= 0; i--)
{
y += GetRowHeight(i);
if (y > pageHeight)
return Math.Max(0, i + 1);
}
return 0;
}