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. Windows Forms
  4. Loading a big file into the Tree Listview

Loading a big file into the Tree Listview

Scheduled Pinned Locked Moved Windows Forms
data-structurestutorial
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.
  • S Offline
    S Offline
    Soma Shekhar
    wrote on last edited by
    #1

    I have a requirement to read the data from the selected files, and populate in the treelistview, currently it is taking more than 10 seconds to display could any body post a sample code how to reduce this time. The file contains at about 10 delimiters to read the contents properly. Most of the file size is more than 5000 lines.

    SomaShekhar

    P 1 Reply Last reply
    0
    • S Soma Shekhar

      I have a requirement to read the data from the selected files, and populate in the treelistview, currently it is taking more than 10 seconds to display could any body post a sample code how to reduce this time. The file contains at about 10 delimiters to read the contents properly. Most of the file size is more than 5000 lines.

      SomaShekhar

      P Offline
      P Offline
      pbalaga
      wrote on last edited by
      #2

      Speeding up the loading process depends also on the way you store data in files. Is it possible to make any precalculations for that data, so that it is not necessary to calculate some things while loading? How do you know where the items from a file should be placed in the treelistview? Try to sort data in your files, so that you know it without any parsing, calculating and so on. E.g. store a value that would indicate how many items there are to load for each branch of the tree. Secondly, you can use e.g. BackgroundWorker class provided with .NET, which will run the loading process on another thread and let you do something else, while loading lasts.

      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