Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Example of Combo Box Selection
Message
 
To
15/10/2004 09:48:40
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00951713
Message ID:
00952241
Views:
9
Joe,

>1. Sychronize the form to a change in the combo box and

>2. Sychronize the combo box to the form should you enable changing records using navigation buttons in addition to the combo box

As Scott indicated, this is pretty straightforward. What you're looking for is very similar to the way the Shipper and Employee combo boxes are set up. Basically you need to:

1. In the combo box BindingSource property, specify a business object to fill the list....in this case, you could specify a Customer business object. You would then specify the text field to be displayed (i.e. CompanyName) in the combo box in the BindingSourceDisplayMember property, and the value of the currently selected item (i.e. CustomerID) in the BindingSourceValueMember property.

2. In the combo box BindingValueSource property specify the business object that determines the currently selected value. In this case, that would be the "Orders" business object. In the combo box BindingValueSource property, you specify where the value is stored/retrieved from...in this case, CustomerID.

3. In the constructor of the form, after the call to InitializeComponent, you need to call a Customer business object method that retrieves a list of Customers.

Check out the MM .NET Dev Guide topic "Data Binding Windows Forms List Controls" for details.

Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform