WEBSWAPP Silverlight ASP.NET 3.5 ASP.NET 2.0 ASP.NET 1.0
Cascading Lists
ITemplate
DDL in GridView
G/V MultiSelect
Nested GridViews
RegExp
DataGrid Reorder
Events fire twice
Hyperlink Field
TextBox
UpdateParameters
MultiView
TreeView
C#-GridView VB-GridView

Dropdownlist within a GridView

This gridview is an orders-list display for the selected customer. Each row displays the order detail and a dropdownlist to select the product on the order. I did the dropdownlist using the business logic layer where I have a clsOrder that exposes a property named Products; the latter returns a generic list of type clsProdListItem; each containing a value and description for the product. By changing the product selection in the dropdownlist, a detailsview displaying the product information becomes visible within the grid's table.

To get the record count of the returned dataset I handle the Selected event of the ObjectDataSource

select a Customer:
Total Record count in the dropdownlist above= 91
Total Record count returned by the query on the GridView= 6

Orders list for the selected customer

 Order IDOrder DateFreightShipNameProducts
Edit10643 25/08/1997 29.4600Alfreds Futterkiste
Edit10692 03/10/1997 61.0200Alfred's Futterkiste
Edit10702 13/10/1997 23.9400Alfred's Futterkiste
Edit10835 15/01/1998 69.5300Alfred's Futterkiste
Edit10952 16/03/1998 40.4200Alfred's Futterkiste
Edit11011 09/04/1998 1.2100Alfred's Futterkiste

Source code:

VB-GridView source code clsOrder.cs clsProduct.cs clsProdListItem.cs