cancel
Showing results for 
Search instead for 
Did you mean: 

How to display only the description of a combobox.

Former Member
0 Kudos

Hi All,

I have a combobox on a grid.

The value of it, is the adresses of BP.

Example :

string sQuery = "SELECT CRD1.Address FROM CRD1 WHERE CRD1.AdresType='S' AND CRD1.CardCode='" + oGrid.DataTable.Columns.Item("U_IFC_PP").Cells.Item(pVal.Row).Value.ToString() + "'";

SAPbobsCOM.Recordset oRec;

oRec = (SAPbobsCOM.Recordset)SBO_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);

oRec.DoQuery(sQuery);

SAPbouiCOM.ComboBoxColumn oCBB;

oCBB = (SAPbouiCOM.ComboBoxColumn)oGrid.Columns.Item("U_IFC_ADR");

while (!oRec.EoF)

{

oCBB.ValidValues.Add(oRec.Fields.Item("Address").Value.ToString(), "");//, oRec.Fields.Item("Address").Value.ToString());

oRec.MoveNext();

}

When i click on the combobox, it's display the value and the description like this :

value1 - Adr1

value2 - Adr2

...

i want to display only the description like the field "Ship To" in the folder "Logistics" in the Sales Order form.

It is possible ?

And what is the size limit of the parameter oCombobox.ValidValues.Add(ByVal Value As String, _

ByVal Description As String _)

Thanks for your response.

Best Regards.

Michael

Accepted Solutions (1)

Accepted Solutions (1)

Nussi
Active Contributor
0 Kudos

Hi Michael,

actually you can't show only the description when you click into it.

the lenght of the description is usually around 50.

(but it depends also how long you made the value.)

the best is to do it so:

keep the value short with numbers

and cut the description at 42 (to be on the safe side)

lg David

Answers (0)