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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Most Efficient Data Control

Most Efficient Data Control

Scheduled Pinned Locked Moved Visual Basic
performancebusinessquestion
4 Posts 3 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.
  • E Offline
    E Offline
    errorfunktion
    wrote on last edited by
    #1

    Hi, I need to display a data set in some sort of table format, which will be scrollable.. This set contains approximately 500 rows of data items, say contact information. Some rows need to be in a different color than the other rows according to some criteria which is why I can't use a big textbox. I was thinking about several ways to implement this: 1. Using a ListView Control 2. Using a DataGrid Control 3. Using a Picture box and simply painting the item information on it. I have no need to interact with the data just display it. 4. Using a TableLayooutPanel and filling it with labels. Which of these ways is the most efficient way to do this, performance wise, least memory requirements, best application responsiveness etc? Thanks, Gary

    L 1 Reply Last reply
    0
    • E errorfunktion

      Hi, I need to display a data set in some sort of table format, which will be scrollable.. This set contains approximately 500 rows of data items, say contact information. Some rows need to be in a different color than the other rows according to some criteria which is why I can't use a big textbox. I was thinking about several ways to implement this: 1. Using a ListView Control 2. Using a DataGrid Control 3. Using a Picture box and simply painting the item information on it. I have no need to interact with the data just display it. 4. Using a TableLayooutPanel and filling it with labels. Which of these ways is the most efficient way to do this, performance wise, least memory requirements, best application responsiveness etc? Thanks, Gary

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Hi, I only know some of these Controls, so here is a partial answer: A PictureBox is not the solution; it does not help you whatsoever, the only thing it tries to do reasonably well is showing an existing IMAGE. It is not intended to be drawn upon (a Panel would fit that). I would not choose the ListView, I expect it is tailored to the Explorer functionality, and either too complex or not really fitting your needs. Hence my choice would boil down to DataGrid vs. TableLayoutPanel Hope this helps.

      Luc Pattyn [Forum Guidelines] [My Articles]


      this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google


      E 1 Reply Last reply
      0
      • L Luc Pattyn

        Hi, I only know some of these Controls, so here is a partial answer: A PictureBox is not the solution; it does not help you whatsoever, the only thing it tries to do reasonably well is showing an existing IMAGE. It is not intended to be drawn upon (a Panel would fit that). I would not choose the ListView, I expect it is tailored to the Explorer functionality, and either too complex or not really fitting your needs. Hence my choice would boil down to DataGrid vs. TableLayoutPanel Hope this helps.

        Luc Pattyn [Forum Guidelines] [My Articles]


        this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google


        E Offline
        E Offline
        errorfunktion
        wrote on last edited by
        #3

        Not really sorry, A picture box provides a graphics object that you may use to draw paint whatever you like on, text included hence it can be used to show a table of data. I may have neglected to mention this: If this data was static then I wouldn't even bother asking the question. New data is constantly received and displayed in new lines while older lines are deleted, this is my concern with performance. The update rate is fast perhaps once a second. Updating a ListView control therefore might seem more efficient since it only requires two actions: add and remove item. Updating the tablepanel will take a loop of 500*NumberOfColumns actions. Which one of the ways I have listed is likely to take the least amount of CPU time?

        D 1 Reply Last reply
        0
        • E errorfunktion

          Not really sorry, A picture box provides a graphics object that you may use to draw paint whatever you like on, text included hence it can be used to show a table of data. I may have neglected to mention this: If this data was static then I wouldn't even bother asking the question. New data is constantly received and displayed in new lines while older lines are deleted, this is my concern with performance. The update rate is fast perhaps once a second. Updating a ListView control therefore might seem more efficient since it only requires two actions: add and remove item. Updating the tablepanel will take a loop of 500*NumberOfColumns actions. Which one of the ways I have listed is likely to take the least amount of CPU time?

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

          errorfunktion wrote:

          A picture box provides a graphics object that you may use to draw paint whatever you like on

          No, it doesn't. Every control that's visible has a canvas you can paint on, not the jsut the PictureBox control. The PictureBox was designed to just show an image. It loads an image and paints that image on itself. For your situation, the ListView control would probably be the most appropriate. You'd have to remember to remove items at the beginning of the list if they are no longer needed since adding more and more items (without removing any!) will take long and longer to paint.

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

          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