ComboBox - Manually add items


Author
Message
Chris Diesel
Chris Diesel
StrataFrame User (184 reputation)StrataFrame User (184 reputation)StrataFrame User (184 reputation)StrataFrame User (184 reputation)StrataFrame User (184 reputation)StrataFrame User (184 reputation)StrataFrame User (184 reputation)StrataFrame User (184 reputation)StrataFrame User (184 reputation)
Group: StrataFrame Users
Posts: 74, Visits: 300
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.

Replies
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
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.
Chris Diesel
Chris Diesel
StrataFrame User (184 reputation)StrataFrame User (184 reputation)StrataFrame User (184 reputation)StrataFrame User (184 reputation)StrataFrame User (184 reputation)StrataFrame User (184 reputation)StrataFrame User (184 reputation)StrataFrame User (184 reputation)StrataFrame User (184 reputation)
Group: StrataFrame Users
Posts: 74, Visits: 300
I think that's what I have Wink.
Chris Diesel
Chris Diesel
StrataFrame User (184 reputation)StrataFrame User (184 reputation)StrataFrame User (184 reputation)StrataFrame User (184 reputation)StrataFrame User (184 reputation)StrataFrame User (184 reputation)StrataFrame User (184 reputation)StrataFrame User (184 reputation)StrataFrame User (184 reputation)
Group: StrataFrame Users
Posts: 74, Visits: 300
Alright, sorry Blush.  'Text' not 'SelectedText'.

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

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
No problem...glad it got you going Smile
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Chris Diesel - 17 Years Ago
Trent L. Taylor - 17 Years Ago
             I think that's what I have ;).
Chris Diesel - 17 Years Ago
Chris Diesel - 17 Years Ago
                     No problem...glad it got you going :)
Trent L. Taylor - 17 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search