private void plotMouseDoubleClick(object sender, MouseEventArgs e) { (double mouseX, double mouseY) = MainPlot.GetMouseCoordinates(); sph.HighlightClear(); var(trackerX, trackerY, index) = sph.HighlightPointNearest(mouseX, mouseY); for (int i = 0; i < dtb.Rows.Count; i++) { DataTable curTable = (DataTable)DGrid.DataContext; DataRow curRow = curTable.Rows[i]; string cellContent = String.Join(", ", curRow.ItemArray); if (cellContent.Contains(trackerX.ToString()) && cellContent.Contains(trackerY.ToString())) { DGrid.ScrollIntoView(DGrid.Items[i]); DGrid.SelectedIndex = i; DGrid.UpdateLayout(); } } MainPlot.Render(); }