StrataFrame Forum

ComboBox - Manually add items

http://forum.strataframe.net/Topic19611.aspx

By Chris Diesel - 9/23/2008

I have a combobox that I need to manually populate in the form's constructor by using Items.Add from a collections passed to the form.  I have set:

DropDownStyle='DropDownList'

Businessobject='my forms business object'

BindingField='my bo field name'

BindingProperty='SelectedText'

PopulateOnFormLoad='Manual'

PopulationType='Manual'

Problem: When I edit an exiting record, the combobox value is blank.  When I select an item from the list and then save, the binding field remains unchanged.

By Trent L. Taylor - 9/23/2008

Well, you are going to have to be consistent in regards to the binding.  If you just want to bind to the text, then you will have to change the BindingProperty to Text instead of SelectedValue.  otherwise, you will need to popupate a data source (i.e. a data table) and set the DisplayMember, ValueMember, and DataSource properties.  But in this case, it sounds like all you need to do is just set the BindingProperty to Text instead of SelectedValue.
By Chris Diesel - 9/23/2008

I think that's what I have Wink.
By Chris Diesel - 9/23/2008

Alright, sorry Blush.  'Text' not 'SelectedText'.

Now the combobox displays the correct value when initially displayed but does not save a different value selected.

By Trent L. Taylor - 9/23/2008

No problem...glad it got you going Smile