In WPF TreeGrid (SfTreeGrid), you can get the TreeNode based on row and column index from the mouse pointer position. The TreeNode can be accessed by using any mouse events (example MouseDoubleClick event). This event is triggered when you double click on the TreeNode. Within this event, you can access the TreeGridPanel by using the GetTreePanel extension method that exists in the Syncfusion.UI.Xaml.TreeGrid.Helpers.
The row index of TreeNode in the clicked position can be retrieved by resolving the mouse click position through TreeGridPanel.PointToCellRowColumnIndex. now, you can get the current TreeNode by passing the RowIndex in GetNodeAtRowIndex method in TreeGrid.
this.treeGrid.MouseDoubleClick += TreeGrid_MouseDoubleClick;
private void TreeGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
var treeGridPanel = this.treeGrid.GetTreePanel();
// get the row and column index based on the pointer position
var rowColumnIndex = treeGridPanel.PointToCellRowColumnIndex(e.GetPosition(treeGridPanel));
if (rowColumnIndex.IsEmpty)
return;
var treeNodeAtRowIndex = treeGrid.GetNodeAtRowIndex(rowColumnIndex.RowIndex);
MessageBox.Show("TreeNode : " + treeNodeAtRowIndex.ToString());
}Visual Studio 2015 and above versions
