Copied to clipboard

Flag this post as spam?

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


  • JoskerVemeulen 67 posts 261 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 28 posts 141 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();
    
Please Sign in or register to post replies

Write your reply to:

Draft