Filippo's listview bugs

RB Smissaert

Well-Known Member
Licensed User
Sofar I have come across 2 bugs in this control.
When doing a column sort (lvw.SortColumn and also lvw.TableSort) the background colour of the control disappears. Resetting it after the sort doesn't help.
Secondly, setting the column widths in AddColumn doesn't behave as expected in that setting the value -1 (to autofit) doesn't work and gives very narrow columns.
Not a bug, but it is also quite a bit slower than the simple Table control, particularly on populating the control. This is when doing:

Reader.Value = cmd.ExecuteReader

Do While Reader.ReadNextRow = True
For c = 0 To UB
arrLVWRow(c) = Reader.GetValue(c)
Next
lvw.AddRow(arrLVWRow())
lRecords = lRecords + 1
Loop

And maybe I should use lvw.LoadSQL but that means I have to make a temp
SQLite table first.


RBS
 

Filippo

Expert
Licensed User
Hi RB Smissaert,

I would say use only lvw.LoadSQL and lvw.SaveSQL, because it it much faster.
But if you want to load the tables over "Reader.Value = cmd.ExecuteReader ... " then you have to use the functions lvw.BeginUpdate and lvw.EndUpdate.


Example:
lvw.BeginUpdate
Reader.Value = cmd.ExecuteReader

Do While Reader.ReadNextRow = True
For c = 0 To UB
arrLVWRow(c) = Reader.GetValue(c)
Next
lvw.AddRow(arrLVWRow())
lRecords = lRecords + 1
Loop
lvw.BeginUpdate


Ciao,
Filippo
 

Filippo

Expert
Licensed User
currently only with "reader.Value = cmd.ExecuteReader ..." :sign0013:
 
Top