This project has moved and is read-only. For the latest updates, please go here.

DataGridControl's TableView not honoring VirtualizingStackPanel.ScrollUnit setting?

Mar 14, 2017 at 10:44 PM
Edited Mar 14, 2017 at 10:45 PM
I prefer pixel scrolling versus row item scrolling for the DataGrid that I'm building. For WPF Fx controls, I can set VirtualizingStackPanel.ScrollUnit="Pixel" to get the desired scrolling behavior, but it appears that TableView ignores this.

Is there a way to get this to work using TableView?

I've tried several approaches here: setting this property on DataGridControl, TableView, and even changing the TableViewScrollViewer template. Nothing seems to stick.
Mar 15, 2017 at 7:12 PM

Because of UI Virtualization, we are not generating all elements. When scrolling, we don't know how many elements there is until destination. The DataGrid would have to generate all elements until destination, which wouldn't be efficient. That's why it's not possible.

But it could work if Virtualization is deactivated. For this, you need to set ScrollViewer.CanContentScroll to False. With this, the ScrollViewer will ask the TableViewItemsHost to generate containers for all the elements from the data source. This way, the ScrollViewer will do pixel scrolling. But with this, all rows and cells will be generated. The bigger is the data source, the longer it will take to load or invalidate the measure.

Get more controls, features, updates and technical support with Xceed Toolkit Plus for WPF
Mar 15, 2017 at 8:21 PM
I obviously don't want to disable virtualization because I'm working with very large data sets, but I also don't want the "snap to row" behavior that exists today because not all row heights are uniform and this can create a really bad experience when taller rows are present.

It's worth noting that the WPF native DataGrid is able to take advantage of Pixel scrolling. If you use VirtualizingStackPanel.ScrollUnit="Pixel" you pixel scrolling without the undesirable row snapping that exists today and it doesn't seem to affect performance any with large lists.
Mar 16, 2017 at 4:11 PM

We don't use a VirtualizingStackPanel in the Xceed DataGridControl. Setting VirtualizingStackPanel.ScrollUnit to "Pixel" won't have any effect.
Using a pixel scrolling in TableView is not available for now in the Xceed DataGrid.


Get more controls, features, updates and technical support with Xceed Toolkit Plus for WPF
Mar 16, 2017 at 7:16 PM
Bummer! I'll file a feature request for this as this is a much better and smoother UX, especially when dealing with mixed row sizes. Thanks!
Mar 16, 2017 at 7:24 PM