Questions tagged [virtualizingstackpanel]

Arranges and virtualizes content on a single line that is oriented either horizontally or vertically.

The standard layout system creates item containers and computes layout for each item associated with a list control. The word "virtualize" refers to a technique by which a subset of user interface (UI) elements are generated from a larger number of data items based on which items are visible on-screen. Generating many UI elements when only a few elements might be on the screen can adversely affect the performance of your application. The VirtualizingStackPanel calculates the number of visible items and works with the ItemContainerGenerator from an ItemsControl (such as ListBox or ListView) to create UI elements only for visible items.

87 questions
127
votes
3 answers

Virtualizing an ItemsControl?

I have an ItemsControl containing a list of data that I would like to virtualize, however VirtualizingStackPanel.IsVirtualizing="True" does not seem to work with an ItemsControl. Is this really the case or is there another way of doing this that I…
Rachel
  • 122,023
  • 59
  • 287
  • 465
34
votes
3 answers

Scrolling in virtualized WPF TreeView is very unstable

If virtualizing is enabled in TreeView with items having various sizes, multiple problems appear: Vertical scroll bar changes its size randomly and doesn't remember sizes of elements after viewing the whole tree. Scrolling with mouse is hard. After…
Athari
  • 32,207
  • 13
  • 100
  • 135
28
votes
3 answers

VirtualizingStackPanel + MVVM + multiple selection

I have implemented a selection pattern similar to the one described in this post using a ViewModel to store the IsSelected value, and by binding the ListViewItem.IsSelected to the ViewModel IsSelected:
decasteljau
  • 7,015
  • 6
  • 38
  • 56
24
votes
1 answer

what is the actual difference between Recycling/Standard of VirtualizationMode property in VirtualizingStackPanel?

What is actually happening in VirtualizingStackPanel.VirtualizationMode = Recycling/Standard.?
Kishore Kumar
  • 20,123
  • 12
  • 75
  • 109
21
votes
1 answer

Synchronizing multi-select ListBox with MVVM

I have two views of some data: a list view (a ListBox now, but I've been meaning to switch to ListView) and a fancy graphical representation on a map. In either view the user can click an object and it will be selected in both views. Multiselect is…
Qwertie
  • 14,053
  • 15
  • 90
  • 131
21
votes
2 answers

What is the difference between a stackpanel and a virtualizingstackpanel in WPF?

What is the difference between a stackpanel and a virtualizingstackpanel in WPF?
Peter
  • 33,550
  • 33
  • 138
  • 185
20
votes
2 answers

ListBox, VirtualizingStackPanel, and Smooth Scrolling in WPF

I have a ListBox that may have many rows of templated DB records, including an Image, bound to an ObservableCollection. Sometimes the collection could hold thousands of items. The performance is great, but the scrolling is the default jumpy…
Joel Cochran
  • 5,023
  • 2
  • 24
  • 35
18
votes
1 answer

Binding to data breaking on VirtualizingStackPanel

First of all, a disclaimer, I'm working with .net 3.5's virtualizingstackpanel. If you get different behavior in future versions let me know. It's relatively simple to set up a test case with listviews that you can test this against. I have an…
James Joshua Street
  • 2,967
  • 9
  • 34
  • 73
13
votes
1 answer

WPF TreeView with IsVirtualizing="true" jumps around when changing focus and scrolling

I've made a simple example to reproduce a problem I'm having with the TreeView. If I select an item in the TreeView, scroll down, change the Focus, and then select an item in the TreeView again, the list starts jumping around. This only happens if…
George
  • 1,468
  • 16
  • 13
11
votes
5 answers

Scrolling to an element of a virtualising ItemsControl

I have a ItemsControl which displays its items in a ScrollViewer, and does virtualisation. I am trying to scroll that ScrollViewer to an (offscreen, hence virtualised) item it contains. However, since the item is virtualised, it doesn't really exist…
Seth Carnegie
  • 70,115
  • 19
  • 169
  • 239
10
votes
4 answers

VirtualizingStackPanel and TextWrapping bug? Windows Phone

I have a strange behaviour with VirtualizingStackPanel. I have a list with items that contains TextBlock with TextWrap="Wrap". Here is the code:
Alexander
  • 1,232
  • 1
  • 15
  • 33
9
votes
1 answer

ItemsControl, VirtualizingStackPanel and ScrollViewer height

I want to display a important list of items using an ItemsControl. The reason why I'm using an ItemsControl is that the DataTemplate is much more complex in the application I'm working on: The sample code provided only reflects the sizing problem I…
Larry
  • 16,649
  • 8
  • 71
  • 100
7
votes
1 answer

Improve performance for huge ListBox in StackPanel?

I am using a StackPanel to layout several controls vertically (ie, Title, sub titles, listbox, separator, listbox, etc). The StackPanel is a child of a ScrollViewer to ensure its content is always scrollable. One of the controls in the StackPanel is…
jayars
  • 1,209
  • 2
  • 13
  • 22
5
votes
1 answer

Virtualizing Panel that doesn't crop items

So, it looks really silly to have a chrome-less collection if the items are getting cut/cropped at the end of the scroll region. I want to create a virtualizing panel for collections (ItemsControl/ListBox) that only draws whole items, never pieces…
Josh G
  • 13,566
  • 7
  • 55
  • 72
5
votes
1 answer

VirtualizingStackPanel Is not working

I have the following ListBox:
Gili
  • 141
  • 2
  • 5
1
2 3 4 5 6