Georgiana
Georgiana

Reputation: 1

Getting the selected value in combobox

How to use the selected value of combobox in other combo box?

Upvotes: 0

Views: 59

Answers (2)

Raskayu
Raskayu

Reputation: 743

Simple as this:

ComboBox2.SelectedValue = ComboBox1.SelectedValue;

Or you can store it in an Integer variable and use it for whatever you need.

Upvotes: 1

shijin
shijin

Reputation: 461

Your question is not clear... but i hope the following code will help you to get an idea..first thing is to get selected value from combo1 and set combo2 selected value equals that value... also you need to make sure that that value should included (or present) in second combo box list...

xyx=Combobox1.SelectedValue;

comboBox2.SelectedValue = xyx;

if you want to change selected value of combo2 then you may need to place the code in "SelectedIndexChanged" event of combo box 1.

Upvotes: 0

Related Questions