New to Telerik UI for WinUI? Download free 30-day trial

Get Row Item and DataGridCellInfo Item from a Physical Point

The following article shows an example of how to get Row item or DataGridCellInfo item from a physical point.

First, create a RadDataGrid.

Example 1: Create DataGrid

<telerikGrid:RadDataGrid PointerMoved="DataGrid_PointerMoved" /> 
When the pointer moves, you will get the current Row item and the DataGridCellInfo item through the PointerMoved event.

Example 2: Get Current DataGridCellInfo

private void DataGrid_PointerMoved(object sender, PointerRoutedEventArgs e) 
{ 
    var physicalPoint = e.GetCurrentPoint(sender as RadDataGrid); 
    var point = new Point { X = physicalPoint.Position.X, Y = physicalPoint.Position.Y }; 
    var row = (sender as RadDataGrid).HitTestService.RowItemFromPoint(point); 
    var cell = (sender as RadDataGrid).HitTestService.CellInfoFromPoint(point); 
} 
In this article
Not finding the help you need?