Topic: Combo Box "Greyed out" option

Hey guys, is there a way i can Grey Out a single "option" inside a combo box? i have some technicians that are unavaiable, former workers you see? and i am wondering if i can grey them out and better yet, put them at the end of that combo box list if possible.
Many thanks

Re: Combo Box "Greyed out" option

Hello.


There is no possibility to paint items in ComboBox. An example for you:

Post's attachments

Attachment icon Employees.zip 143.28 kb, 362 downloads since 2017-09-05 

Dmitry.

Re: Combo Box "Greyed out" option

hi, well that's half of the work right here! I can just get the unaviable personell at the end of the list.

the ideal was if the unaviable comboboxes items were unselectable, but i think i can live with that tongue
Many thanks Dmitry you saved the day once again

4 (edited by AD1408 2017-09-06 10:04:27)

Re: Combo Box "Greyed out" option

Thanks for the sample Dmitry..............


Is it possible to hide Unavailable person not displayed on combo dropdown?
I tried the following but couldn't get the script right.

procedure Form1_ComboBox2_OnDropDown (Sender: string);
begin
If Form1.ComboBox2.Text = '(Unavailable)' then
   begin
   Form1.ComboBox2.DBItemID.Visible := False;
   end;
end;
Adam
God... please help me become the person my dog thinks I am.

5 (edited by derek 2017-09-06 10:20:33)

Re: Combo Box "Greyed out" option

Hi Adam,
Not sure why you want to script it?  Seems a lot more straightforward just to use the filter on the combobox object properties (see attached).
Derek.

Post's attachments

Attachment icon Employees.zip 476.11 kb, 362 downloads since 2017-09-06 

Re: Combo Box "Greyed out" option

Hi Derek,


Thank you very much.........
As always your simple solutions truly appreciated...........


I guess I'm one of those trying to do everything with code. However, I agree that if there is a simpler solution rather than coding I should use it where appropriate rather than trying to code it.
I'm glad we have you around Derek.


I added Dmitry's ordering filter to yours to order available combo items by lastname:

unavaiable = 0 and 1=1 ORDER BY lastname
Adam
God... please help me become the person my dog thinks I am.

Re: Combo Box "Greyed out" option

is there a way instead of dbitemid.visible maybe a "selectable" or "enabled" ?

Re: Combo Box "Greyed out" option

VascoMorais wrote:

is there a way instead of dbitemid.visible maybe a "selectable" or "enabled" ?

There is no property "dbitemid.visible"

Dmitry.