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. CListCtrl InsertItem

CListCtrl InsertItem

Scheduled Pinned Locked Moved C / C++ / MFC
csharpalgorithmstutorial
4 Posts 4 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.
  • A Offline
    A Offline
    Atif Mushtaq
    wrote on last edited by
    #1

    In Report style fot a list ctrl . When I insert items , every new item enters at the top , so if I enter 1,2,3,4 in list control one by one it will look like 4 3 2 1 although i choose the Sorting to None. But I want that every new item should be entered at bottom and i also dont want sorting , sequence in my case is very important. So how to insert every new item at the last of list ctrl. to have such kind of result 1 2 3 4 where 1 entered first , 2 secondly and so on. Unmanaged in a .NET world

    A V 2 Replies Last reply
    0
    • A Atif Mushtaq

      In Report style fot a list ctrl . When I insert items , every new item enters at the top , so if I enter 1,2,3,4 in list control one by one it will look like 4 3 2 1 although i choose the Sorting to None. But I want that every new item should be entered at bottom and i also dont want sorting , sequence in my case is very important. So how to insert every new item at the last of list ctrl. to have such kind of result 1 2 3 4 where 1 entered first , 2 secondly and so on. Unmanaged in a .NET world

      A Offline
      A Offline
      Arjan Schouten
      wrote on last edited by
      #2

      int InsertItem( int nItem, LPCTSTR lpszItem ); nItem is the index in the ListCtrl where your item gets if you insert, it sound like you have hardcoded it to 0. to enter 1, 2, 3, 4 do InsertItem(0, "1"); InsertItem(1, "2"); InsertItem(2, "3"); InsertItem(3, "4"); Arjan

      1 Reply Last reply
      0
      • A Atif Mushtaq

        In Report style fot a list ctrl . When I insert items , every new item enters at the top , so if I enter 1,2,3,4 in list control one by one it will look like 4 3 2 1 although i choose the Sorting to None. But I want that every new item should be entered at bottom and i also dont want sorting , sequence in my case is very important. So how to insert every new item at the last of list ctrl. to have such kind of result 1 2 3 4 where 1 entered first , 2 secondly and so on. Unmanaged in a .NET world

        V Offline
        V Offline
        V 0
        wrote on last edited by
        #3

        if I'm not mistaken AddString or something should add items at the bottom off the list. InsertItem will insert the item at a given position. "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix

        D 1 Reply Last reply
        0
        • V V 0

          if I'm not mistaken AddString or something should add items at the bottom off the list. InsertItem will insert the item at a given position. "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          V. wrote: if I'm not mistaken AddString... ... is a CListBox() method.


          "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

          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