StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Setting the combobox selection based on value...Expand / Collapse
Author
Message
Posted 10/05/2006 1:22:29 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 11/25/2008 10:33:22 AM
Posts: 318, Visits: 460
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
Post #3329
Posted 10/05/2006 1:43:07 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 1:09:23 PM
Posts: 2,686, Visits: 1,888
You should be able to set the SelectedValue property directly, however, there was a logic error in the way that the indexor for the items collection was being called... if the type of the selected value was an integer, then the wrong overload was being called and it would not have given you the correct functionality.  I fixed it and we're going to post an update later today, probably within the next couple of hours.  I'll let you know.


www.bungie.net
Post #3330
Posted 10/05/2006 2:51:01 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 11/25/2008 10:33:22 AM
Posts: 318, Visits: 460
Awesome, thanks!  Yes, the one I was having problems with specifically was using an  integer value as the ValueMember.  That's probably where my problem is coming from.  Let me know when I can download the update.  Thanks again.
Post #3334
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 6:42am

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.109. 9 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.