Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
| Search | Today's Posts | Mark Forums Read
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
  #1 (permalink)  
Old May 29th, 2008, 12:39 PM
Authorized User
 
Join Date: Sep 2004
Location: , , .
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?
  #2 (permalink)  
Old June 9th, 2008, 11:17 AM
Authorized User
 
Join Date: Sep 2004
Location: , , .
Posts: 62
Thanks: 0
Thanked 1 Time in 1 Post
Default

Anyone help with this please?

  #3 (permalink)  
Old June 9th, 2008, 12:42 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
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.