Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mikkel Johansen 116 posts 292 karma points
    Mar 01, 2012 @ 11:46
    Mikkel Johansen
    0

    OrderBy returns wrong sorting when "Name" contains danish letters

    Hello,

    I am facing an issue when trying to sort a DynamicNodeList alphabetically when the words contains non-english characters.

    The letter 'å' seems to be treated like the letter 'a' with an accent instead of an independant letter.

    This results in an example sequence of
        {'Målgruppe', 'Marked', 'Moderne'}

    when in fact the sequence should be
        {'Marked', 'Moderne', 'Målgruppe'}.

    I have not found any way to fix this using .OrderBy("Name")

    Is there a way to change the language to use when sorting?

    Can someone help me get this right?

     

    Thanks in advance

    Mikkel Johansen

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Mar 01, 2012 @ 12:59
  • Chris S. 113 posts 22 karma points
    Mar 02, 2012 @ 16:54
    Chris S.
    0

    If the LINQ is done via the NHibernate LINQ provider, this will most likely be based on the collation of your database.

  • Alex Wilks 27 posts 56 karma points
    Mar 29, 2012 @ 14:11
    Alex Wilks
    0

    I have a similar issue and I was hoping you guys might be able to help me. I have a GlobalFunctions.cshtml file where I have a SortList function that takes and returns a DynamicNodeList.

    As the site is bi-lingual, I need to sort the nodes in the DynamicNodeList by the title attribute depending on the culture. I've tried to apply the techniques suggested in the SO link but DynamicNodeList.OrderBy<T>() only takes one argument, the property. It doesn't allow me to specify a culture.

    Does anyone know of a way in which I can perform a culture specific sort on a DynamicNodeList?

    Thanks

  • Arild Lindeflaten 12 posts 31 karma points
    Apr 19, 2012 @ 14:40
    Arild Lindeflaten
    0

    I'm facing the same problem, and I'm very interested in any solution to this.

  • Mikkel Johansen 116 posts 292 karma points
    Apr 19, 2012 @ 15:22
    Mikkel Johansen
    0

    Bug is reported on Codeplex - Please go vote. So it can be fixed in 4.8.

    http://umbraco.codeplex.com/workitem/30782 

Please Sign in or register to post replies

Write your reply to:

Draft