Setting the combobox selection based on value instead of index


Author
Message
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
I'm using the Inherited UI ComboBoxEdit and I want to save the selection of this and a bunch of other combos on a form and then be able to restore them when I come back to that same form.  The ValueMember and DisplayValue properties may not be the same and for other reasons I need to save out the SelectedValue instead of the SelectedIndex.  I can save it out just fine using the SelectedValue property.  Is there a way to just set a property on the combo box and have it select the corresponding item in the list when I go to restore my selections?  I tried setting SelectedValue to the value which was saved out, but this does not work.  I was going to just right a little method to search through the Items collection and set SelectedIndex based on which item matches the saved SelectedValue.  I just wanted to make sure there wasn't an easier way before I implement unnecessary code.  Thanks Smile
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search