
How can I sort a DBLookuplistbox???
Quote:
> In for example the Explorer you can click on name or size or whatever and
> then the explorer will sort the directory by name/size/whatever.
> I want to do the same with my DBLookuplist, by how can I do this ?!??!
Any data-aware control that displays a list of records from a dataset can
only display those records in the order they are in the dataset. So to
change the order, you need to change the sort order of the dataset.
If the DBLookupList.ListSource is a TDataSource linked to a TTable, the
order will be determined by the active index of the TTable. To change the
list order, you have to change the TTable.IndexName, or create and activate
a new table index.
If the DBLookupList.ListSource is a TDataSource linked to a TQuery, the
order will be determined by the an "order by..." line in the SQL property.
To change the list order, you have to change the SQL and close/open the
query.
--
Stephen Brown