SpreadsheetControl.GetCellFromPoint(PointF) Method
In This Article
Gets a worksheet cell located at the specified point.
Namespace: DevExpress.Xpf.Spreadsheet
Assembly: DevExpress.Xpf.Spreadsheet.v24.2.dll
NuGet Package: DevExpress.Wpf.Spreadsheet
#Declaration
#Parameters
Name | Type | Description |
---|---|---|
client |
Point |
A Point |
#Returns
Type | Description |
---|---|
Cell | A Cell object. |
#Remarks
The code sample below obtain a cell by the clicked point:
using DevExpress.Xpf.Core;
using System.Windows.Input;
using DevExpress.Spreadsheet;
using System.Drawing;
private void spreadsheet_PreviewMouseDown(object sender, MouseButtonEventArgs e)
{
System.Windows.Point p = e.GetPosition(spreadsheet);
Cell cell = spreadsheet.GetCellFromPoint(new System.Drawing.PointF((float)p.X, (float)p.Y));
if(cell != null)
{
//your code here
}
}
See Also