Shouldn't I be able to set the selected item of a combobox with the
SelectedValue property? The ComboBox has four items, the values are 1
through 4. Here's an example of what I'm trying to do:
Sub SetLevel(Level as Short)
cboLevel.SelectedValue = Level
End Sub
I try this assignment, and the SelectedValue property remains Nothing. I
know for sure that the Level variable is within the 1 - 4 range, and no
exception is thrown anyway. Anyone have any idea why this is?
Mike
--
Michael Caputo
Programmer/Database Administrator
Simon Economic Systems Ltd.
The style of cboLevel is DropDown. It's filled with business objects that
contain an ID field and a Description field. ID is the ValueMember and
Description is the DisplayMember. In this case, ID goes from 1 to 4, and I
am attempting to set the SelectedValue to 4.
cboLevel.SelectedValue = 4
Hmmmmm.... I just thought of something, not sure if this would affect the
ComboBox, but the ID field in the business object I'm using is ReadOnly. I
don't see why this would have any effect, but maybe that is the problem.
Any ideas?
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.