Back to results for “Data Binding”
.NET MAUI › Troubleshooting & Common Errors

Why is my CollectionView not updating when data changes?

Intermediate

Answer

The bound collection must be an ObservableCollection (or raise CollectionChanged), and items must raise PropertyChanged for their own field updates. Reassigning a plain List won't refresh unless the holding property notifies. Also ensure updates happen on the UI thread.
// Won't refresh:
Items = new List<Item>(newData);
// Will refresh:
public ObservableCollection<Item> Items { get; } = new();
Items.Clear(); foreach (var i in newData) Items.Add(i);
Real-world example A list that never refreshed is fixed by switching from List to ObservableCollection and mutating it on the UI thread.

Common follow-ups: What interface must the collection implement? | Why must items notify too?