Sample Applications / Order Form / Orders

  Changing Shipper Lookup to Drop Down List

Table of Contents
Sample Applications / Order Form / OrdersPrint||
Changing Shipper Lookup to Drop Down List

There are only three shipping companies in the Northwind database. By default, the web application generator renders the ShipVia field as a lookup.

Ship Via Company Name lookup

A lookup is very useful when there is a long list of options, as it offers sorting, filtering, and quick find. In this situation, the lookup is just a hindrance to the user. Let’s change this lookup to a drop down list.

In the Project Explorer, switch to the Controllers tab. Double-click on Orders / Fields / ShipVia (Int32) –> Shippers node.

ShipVia field in the Orders controller.

Change the following settings:

Property New Value
Items Style Drop Down List
Data Value Field ShipperID
Data Text Field CompanyName

Press OK to save. Press Browse, and wait for the page to load. If you edit an order, you will see that Ship Via Company Name field is now a drop down list.

Ship Via Company Name field is now rendered as a lookup.