Jay
Jay

Reputation: 2295

Is there a workaround to virtualize ItemsControl list while setting CanContentScroll = "false"?

As I learned in Virtualizing an ItemsControl?, I need to set

ScrollViewer.CanContentScroll = "true"

to be able to virtualize the list in my ItemsControl. However this causes a lot of scrolling issues including but not limited to bumpy scrolling and part of my expanded child to get cut off at the bottom of the window. I have googled this extensively and it seems like a lot of people are having issues with this. I however have yet to come across any workarounds.

Does anyone have a work around for this problem?

Upvotes: 2

Views: 1720

Answers (3)

Mark Smith
Mark Smith

Reputation: 1115

You can use <ListView VirtualizingStackPanel.IsVirtualizing="False"> to disable virtualization of the stack panel in a listview. There may be a limitation of not being able to enable virtualization in that case, but you can try enabling it manually and seeing if it works.

Upvotes: 0

Pascal Pich&#233;
Pascal Pich&#233;

Reputation: 610

Maybe you can keep CanContentScroll = true and block scrolling with an other technic.

Upvotes: 0

sellmeadog
sellmeadog

Reputation: 7517

There is no easy or simple workaround; the out-of-the-box VirtualizingStackPanel is what it is and can be somewhat limited. Most solutions require either writing a custom virtualizing panel or a virtualizing data provider. This blog post may help you find a solution that works for you:

http://bea.stollnitz.com/blog/?p=344

Upvotes: 2

Related Questions