cancel
Showing results for 
Search instead for 
Did you mean: 

Display Combo description

Former Member
0 Kudos

I have created a Combobox inside a form,

I had values to it using the below code

oComboBox.ValidValues.Add(oRecordSet.Fields.Item(0).Value, oRecordSet.Fields.Item(1).Value)

But when i select from Combo, only the value gets displayed and not the description

Can anyone help me?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

The DisplayDesc property of the item can be set to True to display the description in the Combo Box. Note that this property is on the Item object, not on the ComboBox specific properties

If loading from XML you can set the "disp_desc" attribute of the item to "1" to get the equivalent effect.

John.

Former Member
0 Kudos

I have the opposite problem - I do NOT want the description to be displayed and the description is always displayed. I have tried setting the "DispDesc" property to false in the code, although this property is already set to false in the XML file. I am running SBO version 6.5 on patch 20. Mina could you tell me which version of SBO you're using?

Former Member
0 Kudos

Hi,

Try this (Delphi code).

// show description instead of value as text in combobox

oitem.DisplayDesc := true;

// show value instead of description as text in combobox

oitem.DisplayDesc := false;

This works fine with 6.5 SP:01.

Lita,

I use Type Libraries to allow code completion in the editor - this simplifies everything.

By the way, did you manage to register an Add-On?

The function call from the Add-On DLL always returns "0" and there are no changes to the registry.

Regards,

Gerold

Former Member
0 Kudos

Hi Gerold, the Item.DisplayDesc = false doesn't work for 6.5 on patch 20 as I've done this in several places without any success. I think I might need to upgrade to service pack one.

Yes I have managed to register my add-on but I am using C# for my add-ons - I posted my C# for registering add-ons in this forum several days ago. I use Delphi when using the DI API, not the UI API as too many of the UI SDK properties are read-only in Delphi, (well it was several months ago when I was testing the UI in Delphi)