Dieter Vanslambrouck
Dieter Vanslambrouck

Reputation: 15

how to use the displayed text from combobox when it's filled by a query

My ComboBox is filled by using a query. I have a SiloId and a SiloName, So the ID is combobox.ValueMember and the name is combobox.DisplayMember.

Normally I need the ID when it's selected . (combobox.SelectedValue) But now I need the text like it's displayed in the ComboBox.

How should I do that ?

Upvotes: 0

Views: 45

Answers (2)

user1659922
user1659922

Reputation: 346

combobox.Text;

or

combobox.SelectedItem;

Upvotes: 1

Bahman_Aries
Bahman_Aries

Reputation: 4808

It's very simple, Use combobox.Text;.

Upvotes: 2

Related Questions