Primary key while interpreting data in ListIconGadget
Posted: Sat Jan 24, 2015 11:25 pm
Greetings to all,
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:
so when selecting rows from database, I remember them with something like this
And when I access them from ListIconGadget I merely use
to access appropriate one in the list.
Is there any more elegant way for that?
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?