Following this question and this question, now I have a TreeView with Hierarchical Data like the picture below:
Because of the big amount of data, I have turned Virtualization
property of the TreeView
on (VirtualizingPanel.IsVirtualizing="True"
).
Now the problem is: scrolling the tree is very unstable. I try to explain the unexplainable behaviour:
- While scrolling, the items get just disappeared / unloaded. With WPF Inspector, I actually see, that they get continously unloaded and loaded again.
- While scrolling through items of level3, the tree doesn't load the items which are still not loaded (as expected), but the next level2 item jumps up, on top of the visible levels 3 items.
Notes:
- Scrolling works normal, when all Level2 Items are collapsed.
- Turning off virtualization solves the scrolling problem (but of course I have loading problem in this case)
- I have read here, that this bug is fixed in .Net 4.5.2. I even tried .Net 4.7.1. The behaviour remained the same.
Is there any way that I can avoid this behaviour?