WPF DataGrid - vertical scrolling

Apr 26, 2009 at 5:43 PM
I found that the WPF DataGrid scrolls only the whole records at time so it is not possible to make visible only a part of the record.

I address this as a problem which I think it is a problem for me because I am using a big form in the details part of the record.
The form is not completely visible nor is scrollable so it is not possible to see the topmost parts of the form, only the bottom part.

Is there any solution to this problem. Is it possible to change the scrolling behaviour of the DataGrid's vertical scroll bar ?

The horizontal scroll bar works perfectly.

Apr 27, 2009 at 2:28 PM
Other items controls (e.g. Listbox) do this too. You can stop it with them by setting ScrollViewer.CanContentScroll to false on the items controls, but I don't know if it'll work with the DataGrid. Worth a shot. (Note: setting CanControlScroll to false will turn off virtualization however).
Apr 28, 2009 at 11:51 PM
Yes, it works for DataGrid too. Now it works as I want but turning virtualization off  is not good enough for me.

In my case, for DataGrid, I can set after ScrollViewer.CanContentScroll="True", but what happens with Virtualization if I set

and   VirtualizingStackPanel.VirtualizationMode="Recycling"  just after ScrollViewer.CanContentScroll="True".

Will be Vistualization turned off after that too ?

Apr 29, 2009 at 12:46 PM
Currently, virtualization will not work if you want to do pixel based scrolling.