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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

drop down box in a table cell

Status
Not open for further replies.

dpanattoni

IS-IT--Management
Jan 29, 2002
76
US
I have a program that needs to create a table with 3 columns and x number of rows. I would like the 2nd column of each row to be a drop-down list box. Is this possible, and if so, how would I do it?

If I can't do this with a table, is there another object that this can be done with?

Thank you in advance.
Dale
 
I also needed to add a dropdown to a grid for every row and this is what I did

// using a string buider to dynamically add a child control to our grid
StringBuilder sbAddControl = new StringBuilder();
sbAddControl.Append(&quot;<SELECT id='ddAlbum' name='ddAlbum' runat='server'>&quot;);

foreach(Album anAlbum in allAlbums)
{
sbAddControl.Append(&quot;<OPTION selected value='& anAlbum.AlbumName &'>anAlbum.AlbumName</OPTION>&quot;);
}
sbAddControl.Append(&quot;</SELECT>&quot;);

cellD.Text = sbAddControl.ToString();
row.cells.add(cellD);

//you know the rest


I hope this will spark some thought and help you figure something out
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top