Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old May 29th, 2008, 12:39 PM
Authorized User
Join Date: Sep 2004
Posts: 62
Thanks: 0
Thanked 1 Time in 1 Post
Default Populating DropDown List in DetailsView Edit Mode.

Here is my dilema. I have a DetailsView on a form that displays an affiliate record on a webform. The information is updateable by the user, but one of the columns "affiliate_make" can be one of 35 options that are stored in a different table. To be specific, auto manufacturer.

So... When the affiliate goes to their account info page it shows their record, and in this example we'll say it shows they are a "Ford" dealer. However, when they edit the record to change address or any other information I want the dealer_make column to be a dropdown list of the auto manufacturers stored in another table. Preferrably with the one they already have selected having focus.

Can this be done?
Old June 9th, 2008, 11:17 AM
Authorized User
Join Date: Sep 2004
Posts: 62
Thanks: 0
Thanked 1 Time in 1 Post

Anyone help with this please?

Old June 9th, 2008, 12:42 PM
Imar's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

Hi there,

In an event that switches the DetailsView to EditMode, use FindControl on the DetailsView to look for the DropDownList. Once you have the DropDownList, you can data bind like you would normally do.



Imar Spaanjaars
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with populating ddl in edit of detailsview hertendreef ASP.NET 2.0 Professional 1 August 16th, 2007 12:21 PM
enabling dropdown list on Edit GS ASP.NET 2.0 Basics 1 March 19th, 2007 12:44 PM
populating a dropdown list with values from datab akshay144 VS.NET 2002/2003 5 May 12th, 2006 10:15 AM
populating a dropdown list within a datagrid in C# akshay144 General .NET 0 May 12th, 2006 04:44 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.