dblookupcombobox delhpi 7

1

I have a problem, I put this combo, I made the link with the table everything right it brings the list of cities, in short, it's a blz.

I would like to know if you have an option to put more inside it, which would be, like this: ALL , São Paulo, Campinas, Jundiaí;

It is passed through facets in sql. as I put the option ALL

    
asked by anonymous 29.03.2018 / 15:36

1 answer

0

Good morning Marcelo Okada. Dude with delphi 7 I "guess" you do not do anything DIRECT with the component. But to do a GAMBIARRA with SQL. See the example that I give you with the city table.

id_cidade int, cidade_nome varcha(50)

In the city table I have the following cities

Rio de janeiro
São Paulo
Cidade A
Cidade B

Then I would do the following SQL to increase the word ALL in the CITY TABLE and eventually appear in DBLukupcombobox .. Still Displaying the All Word As First OPTION list.

select id_cidade, cidade_nome, 1 as ordem from cidade
union all
select -1,'TODAS' , 0 as ordem

order by 3,2

I hope I have understood your need and have been able to express myself clearly. Any doubt about my example is just to speak.

    
30.03.2018 / 17:08