I need to create a listbox with 10 columns and 26000 rows. Using the addrow function takes about 8 seconds. Is there a faster way to do this?
Do
if NumberOfItems > ListBoxItemsServer.RowCount then ListBoxItemsServer.AddRow(str(ListBoxItemsServer.LastRowIndex+1),"","","","","","","","","","") else exit
loop
It takes ages to populate, and no user will want to scroll through 26000 rows.
What is the nature of the data?
You would usually be better off having a search box, and displaying matching records.
If you feel you must have a list that can scroll through 26000 rows:
iOS has a technique where the lists show maybe 10 items, and the 10 you see are fed and reused on demand by a data source.
You can simulate this with (say) a 10 row listbox, coupled with a vertical scrollbar.
Read your data into an array.
refresh the 10 row list with 10 items of data, based on the value of the scrollbar.