I'm using WPF/.NET 4 and when I add the VirtualizingStackPanel.VirtualizationMode="Recycling" property to my ListBoxes, it causes the same list items to be repeated over and over when scrolling. For example, let's say I have a ListBox with 100 items and 10 are visible at a time. When the ListBox first loads I see items 1 - 10, but when I start scrolling down to see the remaining items 11 - 100, items 1 - 10 are repeated over and over as I scroll down, so I'm never able to view items 11 - 100. If I change Recycling back to Standard, then everything works correctly, but the scrolling is horribly slow (my ListItems are fairly complex, with several images, text fields, and buttons in them). When Recycling is on, the scrolling is super fast, but I can only ever view items 1 - 10. Any ideas on what's wrong or how to fix it? Thanks in advance.
WPF ListBox VirtualizingStackPanel.VirtualizationMode="Recycling" causes same list items to always appear
3.3k Views Asked by deadlydog At
1
There are 1 best solutions below
Related Questions in .NET
- Does compiler optimize operation on const variable and literal const number?
- What is the point of definnig Asp.net Intrinsic Objects In different places and what is the different betwen them?
- Deleting Orphans with Fluent NHibernate
- IOrderedEnumerable to vb.net IOrderedEnumerable Conversion
- What is this namespace ITypeOfObjectsBoundToListBox ? Couldn't find it
- .net rest service with JSON string and consumed with java client
- What is best way to check if any of the property of object is null or empty?
- Telerik's WPF RadColorPicker NoColorText property not working
- Possible consequences of duplicate ProgId for different classes
- How are multiple requests to Task.Run handled from a resource management standpoint?
- Optimizing C++ call from C#
- Make a per-web-application object available to Web API and SignalR controllers
- System.ComponentModel.DataAnnotations.Schema namespace conflict
- LINQ Except/Distinct based on few columns only, to not add duplicates
- Not displaying content by its URL string - absolute urls
Related Questions in WPF
- WPF MessageBox Cancel checkbox check
- WPF multiple control property simultaneous changes
- ObservableCollection.CollectionChanged does not select the correct DataTemplate on ToolBar
- Telerik's WPF RadColorPicker NoColorText property not working
- How to automate UI interaction during acceptance test run
- Binding to "this.property" object in VisualStateMenager
- ContextMenu Closes Immediately
- Update ObservableCollection where the items are received from another List
- change content button with trigger
- WPF - How to highlight a combobox border when focused
- Wpf No Highlight on ListBoxItem for Touch Devices
- WPF WebBrowser how best to get Tag trees
- Make a class suitable for Property Change Notification
- WPF Comparing two datatables to find matching values
- how to create folder and file with datetime in wpf application
Related Questions in LISTBOX
- What is this namespace ITypeOfObjectsBoundToListBox ? Couldn't find it
- Wpf No Highlight on ListBoxItem for Touch Devices
- Marshalling C# from DLL to WPF form
- Multiple listboxes created dynamically with event
- WPF Interactions CallMethodAction for DataTemplate in ListCheckBox thrown a exception "Could not find method on object of type"
- WPF Extended ListBox doesn't find definition
- Get selected values of a ListBox
- How can I change hflex zk of Listbox
- Select2 using Ajax (multi select) - when selecting second one first one disappars
- c# How to sort an array and put in a listbox?
- ListBox with nothing selected shows highlighted entry
- Getting selected items from a listbox using the index instead of value
- ListBox with multiselect property loses selected items
- ListBox SelectedItem does not work in MVVM
- How to convert ListBox.items to string of array collection in c#
Related Questions in VIRTUALIZATION
- Commit data in a mysql container
- OSX kext: Can't open IOResouces in ::start() due to owned by some other
- Android Studio - HAX kernel Module not installed
- How feasible is it to virtualise the FILE* interfaces of C?
- what is the use of nested containers and root privilege isolation
- How do I set up a virtual environment with Flask using conda?
- on reboot revert back to original state
- Host Only connection NetBSD to Windows
- Geny Motion v2.4.0. Virtualization engine not found. Plugin loading aborted
- Enabling Virtualization with no option in BIOS (Windows 8.1 basic, Samsung laptop)
- How to set dhrystone benchmark clock rate for emulator?
- an issue when trying to enable virtualization
- Generating fingerprint of virtual machines
- One way communication between vm's?
- How to automate application installation in virtual machine?
Related Questions in RECYCLE
- Why isn't IIS cleaning up the old worker processes (w3wp.exe) on pool recycle leading to website out of memory exception?
- GridView recycles child view that is still visible
- How to stop ListView recycling?
- Recycling data structures in java
- Android listview with checkboxes not behaving as expected
- when should I schedule app pool recycles?
- Python numpy equivalent of R rep and rep_len functions
- WPF ListBox VirtualizingStackPanel.VirtualizationMode="Recycling" causes same list items to always appear
- IIS 7.5: Initial request to website never gets loaded
- Should I set ASP.NET application pool to auto-recycle?
- Is it needed to call Bitmap.recycle() after used (in Android)?
- Bitmap.recycle() - "IllegalArgumentException: Cannot draw recycled bitmaps"
- Is object recycling plausible for entity-component model frameworks
- How can I completely clear a bitmap from memory on Android?
- C# - downsides to recycling resources in finalizer
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Recycling Mode works, as it name implies, by reusing rendered ListBoxItems. When a ListBox item is no longer needed to display an item that has scrolled off the list, the ListBox will reuse it to display one that has scrolled into view.
To change what the ListBoxItem is displaying, the ListBox simply sets its DataContext property to the new item. This requires that the contents of the ListBoxItem have to respond correctly to DataContextChanged events. If you are using only using databinding to populate the controls, this will happen automatically. But if, as your comment implies, you are using some code-behind to update the properties, then you need to make sure that your event handling code is doing the job.