SpreadsheetControl.GetCellFromPoint(PointF) Method

Gets a worksheet cell located at the specified point.

Namespace: DevExpress.XtraSpreadsheet

Assembly: DevExpress.XtraSpreadsheet.v20.1.dll

Declaration

public Cell GetCellFromPoint(
    PointF clientPoint
)
Public Function GetCellFromPoint(
    clientPoint As PointF
) As Cell

Parameters

Name Type Description
clientPoint PointF

A PointF structure specifying the location for which the position is retrieved. The point coordinates are measured in documents units.

Returns

Type Description
Cell

A Cell object.

Remarks

The following code snippet displays cell coordinates of the cell located under the mouse cursor.


spreadsheetControl1.MouseMove+=spreadsheetControl1_MouseMove;
// ...
private void spreadsheetControl1_MouseMove(object sender, MouseEventArgs e)
{
    Cell cell = spreadsheetControl1.GetCellFromPoint(new PointF(e.X, e.Y));
    this.Text = cell == null ? "No Cell" : cell.GetReferenceA1() ;
}
See Also