Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. hwo to sort observabale collection?

hwo to sort observabale collection?

Scheduled Pinned Locked Moved C#
question
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SRKSHOME
    wrote on last edited by
    #1

    Hi, I have observableCollection which contains string types. How do I sort it?

    A D 2 Replies Last reply
    0
    • S SRKSHOME

      Hi, I have observableCollection which contains string types. How do I sort it?

      A Offline
      A Offline
      Abhinav S
      wrote on last edited by
      #2

      Look at this article[^]. It discusses three approaches. The third option, the extension method option, is really the best one.

      1 Reply Last reply
      0
      • S SRKSHOME

        Hi, I have observableCollection which contains string types. How do I sort it?

        D Offline
        D Offline
        DaveyM69
        wrote on last edited by
        #3

        Do you really need to sort the collection itself or just view it as sorted without changing the underlying collection? If the first, follow the previous answers. If the second, then you can just expose an ICollectionView[^] and bind to that rather than to the root collection.

        Dave
        Binging is like googling, it just feels dirtier. Please take your VB.NET out of our nice case sensitive forum. Astonish us. Be exceptional. (Pete O'Hanlon)
        BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups