Gold
Gold

Reputation: 62424

how to do: what i pick on combobox1 will show on combobox2?

how to do: what i pick on combobox1 will show on combobox2 ?

is it possible ? (in C#)

thank's in advance

Upvotes: 0

Views: 69

Answers (1)

Andrew Bezzub
Andrew Bezzub

Reputation: 16032

You need to subscride second combobox on the SelectedIndexChanged event of the first combobox and change value when event triggers. Also you need to make sure that both combobox have several items or you will need to add missing items to second combobox dynamically.

Event handler example:

    private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
    {
        object selectedValue = this.comboBox1.SelectedValue;
        this.comboBox2.SelectedValue = selectedValue;
    }

Upvotes: 3

Related Questions