ZForge.Controls.XPTable.Models.TableModel.RowIndexAt C# (CSharp) Method

RowIndexAt() public method

Returns the index of the Row that lies on the specified position
public RowIndexAt ( int yPosition ) : int
yPosition int The y-coordinate to check
return int
        public int RowIndexAt(int yPosition)
        {
            int row = 0;
            if (this.Table.EnableWordWrap)
            {
                row = this.RowIndexAtExact(yPosition);
            }
            else
            {
                row = yPosition / this.RowHeight;
            }

            if (row < 0 || row > this.Rows.Count - 1)
            {
                return -1;
            }

            return row;
        }