Monday, May 6, 2013

Culture-specific sorting of CollectionViewSource using SortDescription

Just set Culture property of CollectionViewSource:

public CollectionViewSource All { get, private set; }
...
this.All = new CollectionViewSource();
this.All.Culture = new CultureInfo("fi-FI");
...
this.All.Source = this.items;
this.All.View.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending));

No comments:

Post a Comment