#987 – CollectionViewSource Updates on Refresh or Change to Collection

By default, when you’re using a CollectionViewSource to do sorting, grouping and filtering in a list-based control, the sorting/grouping/filtering behavior will only updated when you explicitly refresh the CollectionViewSource (by calling Refresh) or when you add or remove something to the collection.

For example, if we add an actor to a list of actors and we are sorting by last name, the actor will be inserted at the correct spot.

987-001

 

987-002

 

If you change the contents of one of the bound objects, however, the sorting behavior is not updated.  For example, if we change the last name of “Jennifer Jones” to “Garner” and we do not call the Refresh method of the CollectionViewSource, the sorting will be wrong.

987-003

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

Leave a comment