DataGridView.HitTest Method (Int32, Int32)
Returns location information, such as row and column indices, given x- and y-coordinates.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
You can use this method to determine which part of the DataGridView control is located at the specified coordinates. For example, you can call this method—specifying the coordinates of a mouse click—to determine the row and column indexes of the clicked cell or whether a header cell or scroll bar was clicked.
Available since 2.0