DisplayMember of ComboBox

  • Thread starter Thread starter Rod
  • Start date Start date
R

Rod

If I set up a combo box at design time it works just fine.

Now if I place the following 3 lines in the form load procedure (I know they
are correct because they were copied from InitializeComponent)
The first line is obeyed, but the second line is ignored. I know this
because if I look at "DisplayMember" in debug mode I see what it was set to
at design time.

the 3rd line normally causes it to crash, but I guess if I understood what I
was doing wrong with the 2nd line I could figure the rest out.

--------------------

Me.cmbobxFilterLookup.DataSource = Me.datasetFilter.Membership_Status

Me.cmbobxFilterLookup.DisplayMember = "Membership Status"

Me.cmbobxFilterLookup.ValueMember = "Membership Status"
 
Have you tried "Membership_Status" for your DisplayMember? Not that this is
implied from your code which I cannot imply a whole lot but your
display/value members must map to valid column names on your source.

Alex
 
Yes, and to me really sure that it was right I tried
Me.cmbobxFilterLookup.DisplayMember =
Me.datasetFilter.Membership_Status.Membership_StatusColumn.ColumnName

It correctly sets the DataSource but it just ignores the DisplayMember line.
 
Back
Top