Urgent Help : Re-select Combobox Value

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear all,

I'm doing a winform project which uses "ComboBox" in one of the form. The
winform contains "ComboBox" with the values as below: -

this.ComboBox1.Items.AddRange(new object[] {"Apple", "Orange", "StrawBerry"});

Users will select on of the item from the combobox and stored into database.
Users have the rights to update this record.

The question is, how do I select the combobox value base on the value from
database?

I have used "SelectedText", "SelectedValue", but it doesn't seem to be
working.

Please Help. Thanks in advance.

Cheers,
Mae
 
SelectedItem doesn't work as well. Do you have another way?

Stephany Young said:
SelectedItem


Mae Lim said:
Dear all,

I'm doing a winform project which uses "ComboBox" in one of the form. The
winform contains "ComboBox" with the values as below: -

this.ComboBox1.Items.AddRange(new object[] {"Apple", "Orange",
"StrawBerry"});

Users will select on of the item from the combobox and stored into
database.
Users have the rights to update this record.

The question is, how do I select the combobox value base on the value from
database?

I have used "SelectedText", "SelectedValue", but it doesn't seem to be
working.

Please Help. Thanks in advance.

Cheers,
Mae
 
SelectedItem *DOES* work...

With ComboBox1
.Items.AddRange(New Object() {"Apple", "Orange", "StrawBerry"})
.SelectedItem = "Apple"
End With

Mae Lim said:
SelectedItem doesn't work as well. Do you have another way?

Stephany Young said:
SelectedItem


Mae Lim said:
Dear all,

I'm doing a winform project which uses "ComboBox" in one of the form. The
winform contains "ComboBox" with the values as below: -

this.ComboBox1.Items.AddRange(new object[] {"Apple", "Orange",
"StrawBerry"});

Users will select on of the item from the combobox and stored into
database.
Users have the rights to update this record.

The question is, how do I select the combobox value base on the value from
database?

I have used "SelectedText", "SelectedValue", but it doesn't seem to be
working.

Please Help. Thanks in advance.

Cheers,
Mae
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top