Copied to clipboard

Flag this post as spam?

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


  • JoskerVemeulen 68 posts 262 karma points
    Dec 13, 2019 @ 08:22
    JoskerVemeulen
    0

    Sorting a list alphabethical

    Hi,

    filteredLocaties = locaties.Where(p => p.Value<string>("Gemeente").Equals(filter, StringComparison.OrdinalIgnoreCase)).ToList();
    

    This is my locations list. How to I order this alphabeticaly?

    Thank!

  • Lars Heesakkers 38 posts 194 karma points
    Dec 13, 2019 @ 13:54
    Lars Heesakkers
    100

    You can just use the LINQ to order a list of strings:

    filteredLocaties = locaties.Where(p => p.Value<string>("Gemeente").Equals(filter, StringComparison.OrdinalIgnoreCase)).OrderBy(p => p.Value<string>("Gemeente")).ToList();
    
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies