I want to programmaticall y add a dropdown to each row in a certain
column returned to the gridview by my query. I want to do this
entirely in behind-code. My gridview tag in the page will have the
following code and no more.
<asp:GridView ID="gv" runat="server"
AutoGenerateCol umns="false">
</asp:GridView>
Now, I have generated boundfields to add regular data without a
control to the gridview.
Example:
foreach (DataColumn col in tempTable.Colum ns)
{
BoundField bField = new BoundField();
bField.HtmlEnco de = false;
bField.DataFiel d = col.ColumnName. ToString();
bField.HeaderTe xt = col.ColumnName. ToString();
gv.Columns.Add( bField);
}
That's fine, but in one of these columns that comes back, I want it to
contain a dropdownlist that could be filled from a separate sql query
and also have this column be editable.
I've referenced http://www.dotnet247.com/247referenc.../13/65435.aspx
and doing such with a dropdownlist, instead of a button doesn't kill
off my page, but it also does not load my dropdownlist.
Any ideas?
-Jonathan