Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dropdown list invisible until EDIT selected 1

Status
Not open for further replies.
Mar 7, 2001
14
US
I'm trying to populate a dropdownlist for a user to select from when in EDIT mode, but I would rather not have it visible during standard browse mode. Is there an easy way to do this?

Example: I have a table that will show the employee and the team they belong too (both as text) in a datagrid. When EDIT is selected, I would like the team column to show the dropdown list with a list of all the teams selectable. The current team that is assigned would be SelectedIndex assigned. I've tried creating a dropdownlist on the update event, but it keeps coming up as a textbox.

Has anyone done this?

 
Try this:

Add a template column. Put in a label and a drop down list. When the user is in normal browse mode, you simply have the ddl visible = false, and show the label with the team name. When edit is clicked, you hide the label control, but show the ddl. Then, when they're done editing, you just swap visibility again, and assign the new team name to the label.

jack
 
Thanks! I think you got me on the right track. I tried to post it as helpful but their website returned an error with a session variable LOL - looks like they need to ask someone in tek-tips about that!

R/
Nuke
 
I was able to do it with your template idea, along with doing a datgrid.columns.item(#).Visible command on the edit, cancel and update routines. Thanks for the help!

R/

Nuke
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top