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. Need Help with ListCtrl with LOTS of Rows

Need Help with ListCtrl with LOTS of Rows

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelp
11 Posts 5 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
    Jethro63
    wrote on last edited by
    #1

    Greetings: I have this CListCtrl in a dialog and it has the potential to have to display 10's of thousands of records. Originally, I created all the rows and populated ALL of the text items but this took a prohibitively long time. I had thought that it was the text preparation part of the process that was taking so long, so I tried just creating the columns and ALL of the rows I needed but not filling the rows in until the user scrolled. I would then fill in only the rows that came into view. My assumption was incorrect as I discovered that what was taking a great deal of the time was just creating all of the empty rows. What is the usual approach to handling this? The main requirement that I have is that the vertical scroll bar on the list control still reflect the actual number of records that I have. Thanks in advance! Mark

    L 1 Reply Last reply
    0
    • J Jethro63

      Greetings: I have this CListCtrl in a dialog and it has the potential to have to display 10's of thousands of records. Originally, I created all the rows and populated ALL of the text items but this took a prohibitively long time. I had thought that it was the text preparation part of the process that was taking so long, so I tried just creating the columns and ALL of the rows I needed but not filling the rows in until the user scrolled. I would then fill in only the rows that came into view. My assumption was incorrect as I discovered that what was taking a great deal of the time was just creating all of the empty rows. What is the usual approach to handling this? The main requirement that I have is that the vertical scroll bar on the list control still reflect the actual number of records that I have. Thanks in advance! Mark

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      Jethro63 wrote:

      What is the usual approach to handling this?

      It depends on the individual. Some people give up and post a question on a forum like Code Project. Others read the documentation[^] and locate the solution.

      led mike

      J 1 Reply Last reply
      0
      • L led mike

        Jethro63 wrote:

        What is the usual approach to handling this?

        It depends on the individual. Some people give up and post a question on a forum like Code Project. Others read the documentation[^] and locate the solution.

        led mike

        J Offline
        J Offline
        Jethro63
        wrote on last edited by
        #3

        What? All of the documentation from end to end? I searched MSDN under the following search keys: CListCtrl, rows, many CListCtrl, items, many List, rows, many List, items, many List, huge List, rows, lots List, big and lots more - came up with nothing. Had I known to look for the string "Virtual List", I would have but why would I? There's nothing in the word "Virtual" that would lead me to think it would handle many items. It would never have occurred to me to include the word "Virtual" in any of my searches. I wrote to another forum and got a very simple, one line response: "Check out Virtual List". As I am sure that you are a very busy man, can you not see the logic in writing this significantly shorter, more useful, and less sarcastic response? Thank you, Mark -- modified at 14:16 Thursday 8th March, 2007

        M L D 3 Replies Last reply
        0
        • J Jethro63

          What? All of the documentation from end to end? I searched MSDN under the following search keys: CListCtrl, rows, many CListCtrl, items, many List, rows, many List, items, many List, huge List, rows, lots List, big and lots more - came up with nothing. Had I known to look for the string "Virtual List", I would have but why would I? There's nothing in the word "Virtual" that would lead me to think it would handle many items. It would never have occurred to me to include the word "Virtual" in any of my searches. I wrote to another forum and got a very simple, one line response: "Check out Virtual List". As I am sure that you are a very busy man, can you not see the logic in writing this significantly shorter, more useful, and less sarcastic response? Thank you, Mark -- modified at 14:16 Thursday 8th March, 2007

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          I am constantly amazed (on this site) that so many people are trying to write Windows software that have never read (or don't know of the existence of) any of the Platform SDK. When I use a control I always at least check here: Individual Control Information[^] There's an overview section for pretty much every control which contains probably everything one needs to know to start using the control. So for a listview control, a quick look finds this: List-View Controls Overview[^]. There's alot of info there, including a solution to your original question :) These links are to info in the online documentation but IMO every Windows programmer should download the Platform SDK and use the documentation occasionally. Then with two clicks, one can navigate to User Interface | Windows Controls and find a plethora of information. I hope this helps a bit for the future (if not you then maybe someone else reading). Cheers! Mark

          "Great job, team. Head back to base for debriefing and cocktails." (Spottswoode "Team America")

          L 1 Reply Last reply
          0
          • M Mark Salsbery

            I am constantly amazed (on this site) that so many people are trying to write Windows software that have never read (or don't know of the existence of) any of the Platform SDK. When I use a control I always at least check here: Individual Control Information[^] There's an overview section for pretty much every control which contains probably everything one needs to know to start using the control. So for a listview control, a quick look finds this: List-View Controls Overview[^]. There's alot of info there, including a solution to your original question :) These links are to info in the online documentation but IMO every Windows programmer should download the Platform SDK and use the documentation occasionally. Then with two clicks, one can navigate to User Interface | Windows Controls and find a plethora of information. I hope this helps a bit for the future (if not you then maybe someone else reading). Cheers! Mark

            "Great job, team. Head back to base for debriefing and cocktails." (Spottswoode "Team America")

            L Offline
            L Offline
            led mike
            wrote on last edited by
            #5

            Mark Salsbery wrote:

            I am constantly amazed (on this site) that so many people are trying to write Windows software that have never read (or don't know of the existence of) any of the Platform SDK.

            Fish Filet eaters that whine [high-pitched-voice] oh I can't just drag and drop that like in VB while biting into my Fish Filet?[/high-pitched-voice] L O S E R S

            led mike

            M 1 Reply Last reply
            0
            • J Jethro63

              What? All of the documentation from end to end? I searched MSDN under the following search keys: CListCtrl, rows, many CListCtrl, items, many List, rows, many List, items, many List, huge List, rows, lots List, big and lots more - came up with nothing. Had I known to look for the string "Virtual List", I would have but why would I? There's nothing in the word "Virtual" that would lead me to think it would handle many items. It would never have occurred to me to include the word "Virtual" in any of my searches. I wrote to another forum and got a very simple, one line response: "Check out Virtual List". As I am sure that you are a very busy man, can you not see the logic in writing this significantly shorter, more useful, and less sarcastic response? Thank you, Mark -- modified at 14:16 Thursday 8th March, 2007

              L Offline
              L Offline
              led mike
              wrote on last edited by
              #6

              Jethro63 wrote:

              What? All of the documentation from end to end?

              Right because the ListView Overview page doesn't talk about "virtual mode" :rolleyes: The way I see it you have two choices: #1 Get serious and become a software developer #2 Whine about reading documentation

              led mike

              1 Reply Last reply
              0
              • L led mike

                Mark Salsbery wrote:

                I am constantly amazed (on this site) that so many people are trying to write Windows software that have never read (or don't know of the existence of) any of the Platform SDK.

                Fish Filet eaters that whine [high-pitched-voice] oh I can't just drag and drop that like in VB while biting into my Fish Filet?[/high-pitched-voice] L O S E R S

                led mike

                M Offline
                M Offline
                Mark Salsbery
                wrote on last edited by
                #7

                :laugh: And sarcasm is nothing....I've seen people called "stupid" for their questions here LMAO! I'll just never get it....Windows is complex - I can't imagine ever completing a task without consulting the docs. Maybe some people have it all memorized...I'm not one of 'em :)

                "Great job, team. Head back to base for debriefing and cocktails." (Spottswoode "Team America")

                1 Reply Last reply
                0
                • J Jethro63

                  What? All of the documentation from end to end? I searched MSDN under the following search keys: CListCtrl, rows, many CListCtrl, items, many List, rows, many List, items, many List, huge List, rows, lots List, big and lots more - came up with nothing. Had I known to look for the string "Virtual List", I would have but why would I? There's nothing in the word "Virtual" that would lead me to think it would handle many items. It would never have occurred to me to include the word "Virtual" in any of my searches. I wrote to another forum and got a very simple, one line response: "Check out Virtual List". As I am sure that you are a very busy man, can you not see the logic in writing this significantly shorter, more useful, and less sarcastic response? Thank you, Mark -- modified at 14:16 Thursday 8th March, 2007

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

                  Jethro63 wrote:

                  I wrote to another forum and got a very simple, one line response: "Check out Virtual List".

                  Which you then had to turn around and search for. Mike did you a favor by providing you with a link. It all falls under the "Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." adage. You've been taught...


                  "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

                  "Judge not by the eye but by the heart." - Native American Proverb

                  L 1 Reply Last reply
                  0
                  • D David Crow

                    Jethro63 wrote:

                    I wrote to another forum and got a very simple, one line response: "Check out Virtual List".

                    Which you then had to turn around and search for. Mike did you a favor by providing you with a link. It all falls under the "Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." adage. You've been taught...


                    "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

                    "Judge not by the eye but by the heart." - Native American Proverb

                    L Offline
                    L Offline
                    led mike
                    wrote on last edited by
                    #9

                    DavidCrow wrote:

                    It all falls under the "Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." adage.

                    No doubt you have seen the "Fish Filet" comments taken from my modernization of that old adage: Some fishermen are great swimmers, others should always wear a life vest while some should just stay on land and get their Fish Filet at McDonalds.

                    led mike

                    M J 2 Replies Last reply
                    0
                    • L led mike

                      DavidCrow wrote:

                      It all falls under the "Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." adage.

                      No doubt you have seen the "Fish Filet" comments taken from my modernization of that old adage: Some fishermen are great swimmers, others should always wear a life vest while some should just stay on land and get their Fish Filet at McDonalds.

                      led mike

                      M Offline
                      M Offline
                      Mark Salsbery
                      wrote on last edited by
                      #10

                      There's the quote! I had lost it, thanks! :)

                      "Great job, team. Head back to base for debriefing and cocktails." (Spottswoode "Team America")

                      1 Reply Last reply
                      0
                      • L led mike

                        DavidCrow wrote:

                        It all falls under the "Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." adage.

                        No doubt you have seen the "Fish Filet" comments taken from my modernization of that old adage: Some fishermen are great swimmers, others should always wear a life vest while some should just stay on land and get their Fish Filet at McDonalds.

                        led mike

                        J Offline
                        J Offline
                        Jorgen Sigvardsson
                        wrote on last edited by
                        #11

                        I bet the OP will start searching msdn and google more extensively before posting here, from now on... :-D

                        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