tags:

views:

67

answers:

1

I followed the link mentioned in this post http://mokosh.co.uk/post/2009/08/04/how-to-sort-observablecollection/comment-page-1/#comment-75

but having issues getting it to work in Silverlight

I created a property public SortableObservableCollection Terms When I call Terms.Sort(new TermComparer()) the records are still display unsorted on the UI

could some suggest what could be going wrong. thanks

A: 

Make sure you're firing the Collection changed event

OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));  

Since that's what will cause the UI to refresh.

Graeme Bradbury
yes, i do fire OnCollectionChanged. however This does not work Terms = GetTerms().Sort(new TermComparer()); but this works Terms = GetTerms(); Terms = Terms.Sort(new TermComparer());
joblot