[Gambas-user] Synchronized Listboxes or a better way

Benoit Minisini gambas at ...1...
Sun Sep 21 19:17:53 CEST 2008


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




More information about the User mailing list