Quick answer: Unity UI Toolkit ListView still showing previous items after assigning a new itemsSource? The binding doesn’t auto-refresh — you must call Rebuild() (or RefreshItems()).

Switching from inventory A to inventory B updates the underlying list but the ListView keeps showing A’s entries.

Rebuild vs RefreshItems

Rebuild() rebuilds the entire view including the visible cells. RefreshItems() just re-binds existing cells to current data. Use Rebuild after itemsSource swap; RefreshItems after data mutation.

itemsSource Assignment

list.itemsSource = newInventoryItems;
list.Rebuild();

Pair assignment with Rebuild. Skipping the call leaves visible state out of sync.

Single-Item Refresh

For a single changed item: list.RefreshItem(index). Cheaper than RefreshItems.

Bindable Items

For automatic refresh, use a SerializedProperty-bound ListView. Changes to the property propagate without manual rebuild calls — great for editor tooling.

Verifying

Source swap visibly updates the ListView. Item-level mutations show after RefreshItem(index).

“ListView source swaps need Rebuild. Mutations need RefreshItems.”

Wrap your data source in a property-changed pattern with auto-Rebuild — consumers stop forgetting to call the refresh method.