Items in listview not sorted correctly RRS feed

  • Question

  • I have a listview which I reorder by clicking on the gridViewheader. There is one problem though and it is  that our swedish accented characters (for example "ä" which is a with two dots over). For some reason they are sorted like an unaccented character.

    I have tried to set the Items.Culture = Thread.CurrentThread.CurrentCulture;

    have also tried to set the default language/culture by doing this in my App.XAML.cs:

                FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement), new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag)));

    This works when for example using converters (without this code I would get the defualt us culture). But it does not help with sorting the listview (a nd Items.Culture is null.

    Any ideas?

    Tuesday, November 4, 2008 2:31 PM


  • Found the problem. The Main windows of the application had a xml:lang="en-US" tag. After removing that and setting  FrameworkElement.LanguageProperty it worked correct.
    • Proposed as answer by Rahul P Nath Wednesday, November 5, 2008 4:16 AM
    • Marked as answer by Hua Chen Thursday, November 6, 2008 1:36 PM
    Tuesday, November 4, 2008 8:27 PM