I'm using a virtualized treeview in WPF to display a 3 level deep hierarchy with a larger number of child nodes (5000+).
<TreeView Grid.Row="0" Grid.Column="0" Name="TestTree" ItemsSource="{Binding}" VirtualizingStackPanel.IsVirtualizing="True">
...
</TreeView>
What happens is that if I expand the child nodes on the 3rd level and scroll to the very end the content doesn't display correctly and the scroller "flips back" and I can continue to scroll down forever, the behavior repeating after some more scrolling.
This only happens in virtualized mode, but unfortunately due to the large number of child nodes the loading time of the treeview in non-virtualized mode is prohibitive.
I have read the following links on SO here and the original thread on the MSDN forums here but the suggested workaround of calling UpdateLayout()
in the SelectedItemChanged handler did not work for me.
Did anyone else experience this strange behavior before, and if so is there a workaround?
Appreciate any input - thanks!