XPTable.Models.Table.VisibleRowCountExact C# (CSharp) Method

VisibleRowCountExact() private method

Returns the number of visible rows, determined by iterating over all visible rows. Copes with word-wrapped rows.
private VisibleRowCountExact ( ) : int
return int
        private int VisibleRowCountExact()
        {
            int ydiff = 0;
            RowCollection rows = this.TableModel.Rows;
            int visibleHeight = this.CellDataRect.Height;
            int count = 0;
            for (int i = this.TopIndex; i < rows.Count; i++)
            {
                // Don't count this row if it is currently a hidden subrow
                Row row = rows[i];
                if (row != null && (row.Parent == null || row.Parent.ExpandSubRows))
                {
                    ydiff += row.Height;

                    if (ydiff < visibleHeight)
                        count++;
                    else
                        break;
                }
            }

            return count;
        }
Table