XPTable.Models.TableModel.RowIndexAtExact C# (CSharp) Method

RowIndexAtExact() private method

Returns the index of the Row that lies on the specified position. Found by iterating through all rows (i.e. copes with variable height rows).
private RowIndexAtExact ( int yPosition ) : int
yPosition int
return int
        private int RowIndexAtExact(int yPosition)
        {
            int height = 0;
            for (int i = 0; i < this.Rows.Count; i++)
            {
                height += this.Rows[i].Height;
                if (yPosition < height)
                    return i;
            }

            // If we've got this far then its the last row
            return this.Rows.Count - 1;
        }