ZForge.Controls.XPTable.Models.TableModel.RowIndexAtExact C# (CSharp) Méthode

RowIndexAtExact() private méthode

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
Résultat int
        private int RowIndexAtExact(int yPosition)
        {
            int height = 0;
            for (int i = 0; i < this.Rows.Count; i++)
            {
                Row row = this.Rows[i];
                if (row.Parent == null || row.Parent.ExpandSubRows)
                {
                    height += row.Height;
                    if (yPosition < height)
                        return i;
                }
            }

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