Results 1 to 3 of 3

Thread: List View Control

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2001
    Posts
    2

    List View Control

    Hello
    Am having a table which consists of 37000 rows. In my VB application am using List View Control, to which am adding 37000 rows. The loading time it is taking around 1 to 2 min, but when i use the command listview1.clear then it is taking nearly 15 to 17 min, to clear the list view control.

    I had done this by using the windows common control service pack 3.0. After that to test i have changed the windows common control service pack 3.0. to 2.0, then for loading time it is taking maximum, but to clear the list view it is clearing with in seconds i.e. less than one min.

    So suggest me how to over come this problem. Do we have any API control to add items in the list view control and clear the list view control.
    URS
    Vegesna

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Why in the world would you want to load that many rows into a Listview? Who is going to sift through 37000 rows?

    I personally would sift through 100 let alone 37000. I don't mean to be rude, but maybe you should rethink the program design to break that amount into groups or something.

  3. #3
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Well ...

    Just an odd thought. If clearing a listview takes that much time, would it be better to create a listview at runtime, and instead of clearing it, just destroy that instance and create a new one?

    vegesna, you can try using the Sheridan grid control, if you can afford to buy it. It's a very good control for such activities. It minimizes the resources used in reading all the data, by not reading all the records in the beginning. Based on the visible portion of the grid, it only loads as many records as are actually going to be required.

    Or implement some clever technique to imitate the above-mentioned functionality in the Listview. Something like:

    Code:
    'Load First 100 Records
    'Listview has records from 1 to 100.
    'Track user scrolling.
    'When user reaches record no. 70 or above in the list, discard the first 50 and load the next 50.
    'The Listview now has records from 51 to 150.
    .
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width