The original source source is not connected to a container with the so-called element container (see DataGrid.ItemContainerGenerator), therefore, trying to figure out hiearchy, although a good idea will not lead you far.
For pretty dumb simple solutions, you could use the knowledge that it only clicked one , and thus using this cell with a click to get a column like this:
private void DataGrid_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e) {
This may not be the most beautiful of solutions, but the simplest is the king.
Hope this helps!
source share