PDA

Click to See Complete Forum and Search --> : Need help causing a listview to scroll programmatically


mskvarenina
Jan 23rd, 2000, 08:28 AM
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.

JeffSM
Jan 23rd, 2000, 08:52 AM
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!

menphis@pro.via-rs.com.br
Jefferon

mskvarenina
Jan 23rd, 2000, 09:02 AM
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.