Results 1 to 3 of 3

Thread: Need help causing a listview to scroll programmatically

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Cliffwood Beach, NJ, USA
    Posts
    6

    Post

    I need to scroll a listview programmatically. Basically I have a very large database and I want to load the first 25 records and provide the user with a "next 25" button. When they press this button I will "add" another 25 items to the listview but I need to "scroll" the listbox up one page so records 26-50 show.

    As an alternative, I'd also appreciate suggestions on how to handle this large database situation. Basically I have about 1 million names in a database. I am giving the user a search option that begins reading the database at the first name that matches, then I load the listview with 25 records. Perhaps there's another control or method out there to accomplish this. I obviously can't load the entire listview at once.


  2. #2
    Registered User
    Join Date
    Apr 1999
    Location
    Brazil
    Posts
    144

    Post

    Why don't you use a DBList with SQL! I'm using:

    SELECT * FROM Table1 WHERE tabNameCli like 'a*';

    This is very fast even with 4000 records.

    If you have 1 million the use at least 4 characters in the like clausule.

    If you NEED use ListView I suggest you to use COMCTL32.OCX (Vs. 5.0) that is up to 20% faster then MSCOMCTL.OCX (Vs. 6.0).

    I use a search that loads 600 itens in about 1.5 seconds, using images.

    I don't konw how is the arquiteture of your network so I can't suggest you the best way.

    E-mail me and we'll talk about, if you want!

    [email protected]
    Jefferon

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Cliffwood Beach, NJ, USA
    Posts
    6

    Post

    Thanks for the reply. I cannot use SQL in this case because I am not connecting to an SQL database. But I just figured it out. I already had a ListItem variable that I was using to add SubItems with. All I had to do was do a itmX.EnsureVisible after loading the 25 records. This works like a charm. It's a shame little things like this aren't documented with good documentation from MS.

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