I have noticed that there is no (easy, or perhaps at all while considering multiplatform approach) to hide column in ListIconGadget, while this is essential in dealing with databases where you have to remember primary key in order to process further queries. In Windows, partial workaround is to make column width '0', but that doesn't work on other OS'es.
For that purpose, I am using the following structure:
Code: Select all
Structure DatabaseRow
ID.i
Array Columns.s(1)
EndStructureCode: Select all
NewList ListView().DatabaseRow
;Our imaginary query with 11 columns, 1st column is primary key and other 10
;are displayed in ListViewGadget
;...
While NextDatabaseRow(0)
AddElement (ListView())
ListView()\ID = Val(GetDatabaseString(0, 0))
ReDim ListView()\Columns(9)
For i = 1 To 10
ListView()\Columns(i - 1) = GetDatabaseString(0, i)
Next
Wend
Code: Select all
SelectElement(ListView(), GetGadgetState(#ListViewGadget))Is there any more elegant way for that?

