06-23-2017 2:17 PM - edited 02-03-2024 10:33 PM
How do I get a combobox selected value ?
In the attached screen shot , Payment Terms drop down list i have chosen "30 Days EOM" value .
Using c# code, how can get ComboBox(dropdown) selected value.
This is my sample code for getting text box values, same way how to get drop down selected text.
Thanks.
SAPbouiCOM.EditText oEdit = null;
SAPbouiCOM.Item oItem = null;
oItem = oForm.Items.Item("234000013");
oEdit = ((SAPbouiCOM.EditText)(oItem.Specific));
primaryPartyCode = (oEdit.String);
Hi Werner,
Use something like this:
SAPbouiCOM.ComboBox cbx = (SAPbouiCOM.ComboBox)oForm.Items.Item("your id").Specific;
if (cbx.Selected != null)
{
string descrition = cbx.Selected.Description;
string value = cbx.Selected.Value;
}
Hope it helps.
Kind Regards,
Diego Lother
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Diego,
Your mention code working very fine.
Thank you your prompt replay Diego Lother.
Hi Werner,
For check box:
SAPbouiCOM.CheckBox chk = (SAPbouiCOM.CheckBox)oForm.Items.Item("your item id").Specific
bool isChecked = chk.Checked;
For option button:
SAPbouiCOM.OptionBtn optb = (SAPbouiCOM.OptionBtn)oForm.Items.Item("your item id").Specific
bool selected = optb.Selected;
Hope it helps.
Kind Regards,
Diego Lother
User | Count |
---|---|
98 | |
8 | |
6 | |
5 | |
5 | |
4 | |
3 | |
2 | |
2 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.