Saturday, October 20, 2012

Order Form Sample–Part 12

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.

No comments:

You can find more about Code OnTime Generator, Data Aquarium Framework, and other great products here.


© 2010 Code OnTime LLC. Intelligent code generation software for ASP.NET. Visit us at http://codeontime.com