ZForge.Controls.TreeViewAdv.Tree.AutoRowHeightLayout.GetFirstRow C# (CSharp) Method

GetFirstRow() public method

public GetFirstRow ( int lastPageRow ) : int
lastPageRow int
return int
        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;
        }