I believe my question is not new here, but I think it is valuable because there are so many results from google with the 'dropdownlist in detailsview' as keywords.
Well, my question is described as below. (ASP.net and C#)
1) I need a detailsview to add and edit record of table T1, which contains products information. T1 has a field 'catalog' which indicates the catalog of the product. All possible catalogs is stored in table T2. The simplified tables is described in 2)
2) Simplified tables:
- T1 fields: id, prodname, catalog; which is the datasource of the DetailsView.
- T2 fields: id, catalog; which is the datasource of the dropdownlist in the detailsview.
- all record of T1 have a catalog, which is picked up from T2.
3) Functions I need are:
- when detailsview in edit mode and insert mode, the field catalog should turns from a textbox to a dropdownlist which contains the catalogs stored in T2 .
- when the item(catalog) of dropdownlist is selected and the 'update' button is clicked, the selected catalog (from T2) should replace the exist one of T1.
4) My procedures to achieve the functions were:
- drag and drop a detailsview control to a page, bind a datasource to it, en
View Complete Post