Object Reference > True DBGrid Methods > RowContaining Method |
RowContaining Method
The RowContaining method returns the zero-based index of the display row containing the specified coordinate.
object.RowContaining(coordinate)
Arguments
coordinate is a single that defines a vertical coordinate (Y value) in twips.
Return Value
An integer corresponding to the display row beneath the specified Y coordinate.
This value ranges from 0 to VisibleRows - 1.
When handling mouse and drag events, this method is useful when you need to determine where the user clicked or dropped another control in terms of a grid row.
If coordinate is outside of the grid's data area, this method returns -1.
Note
You must convert the coordinate argument to twips, even if the container's ScaleMode (Visual Basic) setting specifies a different unit of measurement.