I recently had this problem about scrolling and focus changing.
I solved it by adding in my DataGrid the following:
<DataGrid.Template>
<ControlTemplate>
<ItemsPresenter />
</ControlTemplate>
</DataGrid.Template>
The scrolling now works fine, but a new problem appeared: the DataGrid‘s headers do not show anymore. It is actually logic, since now my DataGrid will only show an ItemsPresenter without taking care of the headers. I am therefore trying to define an appropriate template, showing first the headers and then the items in an ItemsPresenter, allowing me to scroll easily.
Am I just missing something, or is that a different property to override?
Thanks!
This is what the default DataGrid template looks like (in the Classic theme):
Notice that it uses a
DataGridColumnHeadersPresenter. You will want to add this to your template as well.