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



Manually Populating a combo boxExpand / Collapse
Author
Message
Posted 08/02/2006 2:31:37 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 07/09/2008 2:20:16 PM
Posts: 436, Visits: 944
How do I manually populate a combo box using a business object? I want to be able to choose which fill method to execute when the form opens and I'm not sure how to setup the combo box so that its filled manually. Which properties do i have to set?

THanks
Post #2062
Posted 08/02/2006 2:42:24 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 5:02:56 PM
Posts: 2,682, Visits: 1,882
The best way to dynamically populate a combo box using a business object is to use the type editor for the combo box and set the PopulationDataSourceSettings through the type editor.  Then open the .Designer.vb file for the form that contains the combo box.  In the form designer generated code (in the InitializeComponent() method), you will see the a new ListPopulationSettings object get created, have its properties set, and then it is set as the value for the PopulationDataSourceSettings.  Copy that code from the .Designer.vb file and paste it into your main code file where you want to dynamically populate the combo.  Repeat the process for the rest of the methods that you want to be able to call to fill the combo box. 

Once you have all of the pieces, set the combobox's PopulateOnFormLoad property to "Manual." Then, when you want to populate it, set the appropriate PopulationDataSourceSettings that you copied over and then call Requery() on the combobox. 

We do this quite regularly with list views.  We'll use one list view and have a method that dynamically creates the PopulationDataSourceSettings depending upon what is selected within the left-hand tree view.


www.bungie.net
Post #2063
« 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:21pm

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.