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. Is there a way to sort Listview columns numericly?

Is there a way to sort Listview columns numericly?

Scheduled Pinned Locked Moved C#
tutorialquestion
3 Posts 2 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.
  • M Offline
    M Offline
    Minosknight
    wrote on last edited by
    #1

    I am aware how to do it alphabetically (ascending/descending) but I am unfamiliar if its capable to do the same with numbers and such.

    public static void DoSomething() { DoSomethingElse(); } public static void DoSomethingElse() { Dosomething(); }

    B 1 Reply Last reply
    0
    • M Minosknight

      I am aware how to do it alphabetically (ascending/descending) but I am unfamiliar if its capable to do the same with numbers and such.

      public static void DoSomething() { DoSomethingElse(); } public static void DoSomethingElse() { Dosomething(); }

      B Offline
      B Offline
      BoneSoft
      wrote on last edited by
      #2

      You'll likely want to write a custom IComparer for that. Then set the ListViews ListViewItemSorter property to an instance of your comparer. You do mean sort list items by column, not sort columns, right?


      Try code model generation tools at BoneSoft.com.

      M 1 Reply Last reply
      0
      • B BoneSoft

        You'll likely want to write a custom IComparer for that. Then set the ListViews ListViewItemSorter property to an instance of your comparer. You do mean sort list items by column, not sort columns, right?


        Try code model generation tools at BoneSoft.com.

        M Offline
        M Offline
        Minosknight
        wrote on last edited by
        #3

        I will give it a try, thanks. Yes, that's what I meant.

        public static void DoSomething() { DoSomethingElse(); } public static void DoSomethingElse() { Dosomething(); }

        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