Exercise - List Controls
- Add new UIController to the Exercises folder, name the new UIController ControlsDemo.
- Set the Orders table as the main table
- Add OrderID, ShipCountry to a grid on the form.
- Add 3 ComboBoxes to the grid. For each combobox you need to:
- Add a column to the grid.
- Place a ComboBox from the toolbox in the new column.
- Name the column:
- Customer.
- Employee.
- Shipper.
- The 3 ComboBoxes will show data from :
- CustomerID.
- EmployeeID.
- ShipVia.
- Set the Name property of the 3 ComboBoxes to :
- cmbCustomer.
- cmbEmployee.
- cmbShipper.
- In ControlsDemo controller define these 3 tables:
- Customers.
- Employees.
- Shippers.
- Go to the code behind of ControlsDemo form and set:
- cmbCustomer ListSource to be customer table from the controller.
- cmbCustomer ValueColumn to be CustomerID.
- cmbCustomer DisplayColumn to be CompanyName.
- cmbEmployee ListSource to be Employees table from the controller.
- cmbEmployee ValueColumn to be EmployeeID.
- cmbEmployee DisplayColumn to be LastName.
- cmbShipper ListSource to be Shippers table from the controller.
- cmbShipper ValueColumn to be ShipperID.
- cmbShipper DisplayColumn to be CompanyName.
- Save changes to Git.
- Build and test.
- Add Where to show records where the order ShipCountry is equal to UK.
- Save changes to Git.
- Build and test.
- Set the cmbCustomer to show only UK customers.
- Save changes to Git.
- Build and test.
- Set the cmbEmployee to show only UK Employees.
- Save changes to Git.
- Build and test.
Help us improve, Edit this page on GitHub
or email us at info@fireflymigration.com