Click here to Skip to main content
15,896,526 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I already add items in combobox

C#
comboBox1.Items.Add(new ListItem("PLASTMANN","PMN"));
comboBox1.Items.Add(new ListItem("CYBERMATE", "CBM"));
comboBox1.Items.Add(new ListItem("CYBERLEAP", "CLP"));
comboBox1.Items.Add(new ListItem("CYBERMANN", "CMN"));


but I want to get the Text and Value separately.

thank you for you help.
Posted

1 solution

You can use

C#
comboBox1.SelectedValue.ToString();


and

C#
comboBox1.SelectedText.ToString();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900