Re: How do you populate a ListView?
- Posted by Derek Parnell <ddparnell at bigpond.com> Oct 18, 2003
- 436 views
----- Original Message ----- >From: ronaustin at alltel.net >Subject: How do you populate a ListView? > > > >I am trying to display the contents of a database using listview. I am >looping through the database to populate the list box using this little >snippette: > >count = addLVItem(myLV,1,db_key) >count = addLVItem(myLV,2,db_data) >Instead of getting the key in column1 and the data in column2 it is putting >the the first key in column one with it's data under it and then it puts the >second key in the first column with it's data under that. Nothing is going >into column 2. What am I doing wrong? I really should rename addLVItem() to something like addLVRow() because that's what it does. It adds an entire row of listview column data items in one go. You need to give it all the column values as a sequence in the last parameter. The second parameter is meant to be a handle to an icon. So try this instead... count = addLVItem(myLV, 0, {db_key, db_data} ) This assumes that you have created or set up the listview with the correct number of columns. -- Derek