Problem:
If my DataGrid
is not entirely visible (horizontal & vertical scrollbars are showing) and I click on one of my cells that is p
I had the same problem as Rumit, but found a solution/hack.
I thought if I could find a way to differentiate between mouse clicks and arrow keys, then I could set e.Handled accordingly.
After some experimentation I found that e.OriginalSource changed depending on mouse or arrow key. For a mouse click, the handler for RequestBringIntoView is called once and e.OriginalSource was of type DataGridCell. For an arrow key, the handler is called twice and e.OriginalSource is of types DataGridRow and then DataGridCell.
The code for my handler is:
e.Handled = (e.OriginalSource is DataGridCell);
This seems like a bit of a hack, but works great for me.