[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.axapta.programming

How to get the selected text in a combo box

jxiang

10/4/2005 9:55:00 PM

I add items to a combo Box using code:

combobox.add(_ItemText);

_ItemText is a string. The code works fine and the drop down list of the
combo box is as what I expected. However I can only get a 0 based integer
number from the selection of the combo box. I want to get the selected text
in the drop down list. How to do it? Thanks.





4 Answers

Necmi Göcek

10/5/2005 6:39:00 AM

0


--
_MIB_


"jxiang" wrote:

> I add items to a combo Box using code:
>
> combobox.add(_ItemText);
>
> _ItemText is a string. The code works fine and the drop down list of the
> combo box is as what I expected. However I can only get a 0 based integer
> number from the selection of the combo box. I want to get the selected text
> in the drop down list. How to do it? Thanks.
>
>
>
>
>

Luegisdorf

10/10/2005 9:21:00 AM

0

Hi Jxiang

I just tried to reproduce and can''t get the text too. It look like text()
and valueStr() method doesn''t work correctly. May be this could be a bug in
the kernel. I was using Service Pack 4.

Best regards
Patrick

"jxiang" wrote:

> I add items to a combo Box using code:
>
> combobox.add(_ItemText);
>
> _ItemText is a string. The code works fine and the drop down list of the
> combo box is as what I expected. However I can only get a 0 based integer
> number from the selection of the combo box. I want to get the selected text
> in the drop down list. How to do it? Thanks.
>
>
>
>
>

JF

10/13/2005 2:44:00 PM

0

Hi,

use the selection() method to get the ID of the selected item of your
combobox. With this ID you may get the selected text using the getText()
method.

Example:

int text;
text = combobox.selection();
print combobox.getText(text);

cheers!



"jxiang" wrote:

> I add items to a combo Box using code:
>
> combobox.add(_ItemText);
>
> _ItemText is a string. The code works fine and the drop down list of the
> combo box is as what I expected. However I can only get a 0 based integer
> number from the selection of the combo box. I want to get the selected text
> in the drop down list. How to do it? Thanks.
>
>
>
>
>

jxiang

10/13/2005 4:18:00 PM

0

It works. Thanks.

"JF" wrote:

> Hi,
>
> use the selection() method to get the ID of the selected item of your
> combobox. With this ID you may get the selected text using the getText()
> method.
>
> Example:
>
> int text;
> text = combobox.selection();
> print combobox.getText(text);
>
> cheers!
>
>
>
> "jxiang" wrote:
>
> > I add items to a combo Box using code:
> >
> > combobox.add(_ItemText);
> >
> > _ItemText is a string. The code works fine and the drop down list of the
> > combo box is as what I expected. However I can only get a 0 based integer
> > number from the selection of the combo box. I want to get the selected text
> > in the drop down list. How to do it? Thanks.
> >
> >
> >
> >
> >