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 / C++ / MFC
  4. Sorting In A Virtual ListControl

Sorting In A Virtual ListControl

Scheduled Pinned Locked Moved C / C++ / MFC
algorithmstutorial
2 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.
  • J Offline
    J Offline
    jannathali
    wrote on last edited by
    #1

    I am Having a Virtual List Control,with 5 columns.if i double clock on the first column i want to sort the list by that column,& if i clicked on second column i want to sort it by that column & till the last column. how i can accomplish this.Can i get a simple example of this

    C 1 Reply Last reply
    0
    • J jannathali

      I am Having a Virtual List Control,with 5 columns.if i double clock on the first column i want to sort the list by that column,& if i clicked on second column i want to sort it by that column & till the last column. how i can accomplish this.Can i get a simple example of this

      C Offline
      C Offline
      Code o mat
      wrote on last edited by
      #2

      As far as i know virtual list controls do not provide you with any means of sorting, you have to do it yourself. If the user clicks a column header you get a LVN_COLUMNCLICK[^] notification from your list control (i don't know about doubleclick, look around List View[^] in MSDN), upon this message you should/need to sort your data yourself (using some nice sorting algorithm like Quick-sort[^]) and then redraw the list items. Good luck.

      > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Sometimes you just have to hate coding to do it well. <

      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