If a row is selected I can access the selectedItem, but when nothing is yet selected I don't see a way to find which row that was right-clicked.
Is it possible?
2 Answers, 1 is accepted
0
Nasko
Telerik team
answered on 14 May 2018, 08:50 AM
Hello Andrew,
You can use the HitTestService of the DataGrid to get the cell you have tapped. That service provides a method called CellInfoFromPoint that will return an information for the tapped item by only passing the position that you have tapped:
if (e.Pointer.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Mouse)
{
var currentPoint = e.GetCurrentPoint(this);
if (currentPoint.Properties.IsRightButtonPressed)
{
var cell = this.DataGrid.HitTestService.CellInfoFromPoint(currentPoint.Position);
//Implement your logic here
}
}
}
I hope this will help you.
Regards,
Nasko
Progress Telerik
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items