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. reverse the listview Item

reverse the listview Item

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

    Hi all, I just want to have a feature to reverse the order of some of my selected ListViewItems. for example, I would like to reverse the order of Items50 - Items 100 only. Does anyone know the simple way to do this? Thanks.

    D M 2 Replies Last reply
    0
    • A azusakt

      Hi all, I just want to have a feature to reverse the order of some of my selected ListViewItems. for example, I would like to reverse the order of Items50 - Items 100 only. Does anyone know the simple way to do this? Thanks.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      azusakt wrote:

      I would like to reverse the order of Items50 - Items 100 only. Does anyone know the simple way to do this? Thanks.

      AFAIK, there isn't an easy way to do this. I'm guessing you'd probably have to remove all the items from the ListView, then re-add them in the order you want them to appear.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      1 Reply Last reply
      0
      • A azusakt

        Hi all, I just want to have a feature to reverse the order of some of my selected ListViewItems. for example, I would like to reverse the order of Items50 - Items 100 only. Does anyone know the simple way to do this? Thanks.

        M Offline
        M Offline
        mav northwind
        wrote on last edited by
        #3

        Hi! You can achieve this quite easily by writing a class to assign to the ListView's ListViewItemSorter property. Within your LVItemSorter you can sort to your heart's desire without having to remove and re-insert items.

        Regards, mav -- Black holes are the places where God divided by 0...

        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