Add multiple Database data columns in one ListView cell

Hi,
is it possible to add multiple data taking from multiple columns in a Database and merging into one only cell in a ListView ?
Actually i populate my ListView taking one column at time and inserting in each ListView cell, but how to merge in 1 cell of ListView for example data taken from Database Column 5 and 6 ?

[code]If data <> Nil Then
For Each row As DatabaseRow In data
ListView.AddRow(row.Column(“ID”).StringValue, row.Column(“Column1”).StringValue, row.Column(“Column2”).StringValue, _
row.Column(“Column3”).StringValue, row.Column(“Column4”).StringValue, row.Column(“Column5”).StringValue), _
row.Column(“Column6”).StringValue
ListaView.RowTagAt(ListView.LastAddedRowIndex) = row.Column(“ID”).IntegerValue
Next

data.Close
End If[/code]

Ok found it :slight_smile:

[code]If data <> Nil Then
For Each row As DatabaseRow In data
ListView.AddRow(row.Column(“ID”).StringValue, row.Column(“Column1”).StringValue, row.Column(“Column2”).StringValue, _
row.Column(“Column3”).StringValue, row.Column(“Column4”).StringValue, row.Column(“Column5”).StringValue) _
+ row.Column(“Column6”).StringValue
ListaView.RowTagAt(ListView.LastAddedRowIndex) = row.Column(“ID”).IntegerValue
Next

data.Close
End If[/code]

please be aware that if you have many database rows (>1000) this method will be very slow and unresponsive.
and more if you’re using a remote database

and how to improve in that case (large database) ?

you must implement a paging system, requesting from the database only the rows that are really visible on the listbox.
I used a containercontrol having a listbox and a scrollbar to do this. it is quite a job to do it, but is really worth it.