[Gambas-user] Synchronized Listboxes or a better way

MaxVK maximvonk at ...626...
Sun Sep 21 19:43:26 CEST 2008




Benoit Minisini wrote:
> 
> On dimanche 21 septembre 2008, MaxVK wrote:
>> I am loading information from a sqlite3 database file using a query. The
>> results have two fields, Filename and Filepath.
>>
>> The Filename information is to be loaded into a list box where
>> sorted=true.
>> Clicking on an item in the filename list will show the Filepath string.
>>
>> At the moment I am loading the filenames into one list and the filepaths
>> into another list, but of course the filename list is sorted, so the
>> connection to the associated filepath in the other list is broken.
>>
>> Is there a way to keep the lists synchronized when one list is sorted or
>> is
>> there an easier way to do this, remembering that the filename list is to
>> be
>> visible at all times, and that there may be duplicate filenames, although
>> the related filepaths will of course be different?
>>
>> Thanks
>>
>> Max
> 
> You must replace the ListBox controls by ListView controls, and implement
> the 
> Compare event handler to do the sort yourself.
> 
> Regards,
> 
> -- 
> Benoit Minisini
> 

Thanks Benoit. I gave the two items matching keys in the listviews, and then
used MoveNext etc to match them up.

Regards

Max
-- 
View this message in context: http://www.nabble.com/Synchronized-Listboxes-or-a-better-way-tp19596329p19596625.html
Sent from the gambas-user mailing list archive at Nabble.com.





More information about the User mailing list