Wednesday, March 19, 2008

Binding a Drop Down In A GridView

Here is a sample of how to bind to a drop down list in a grid view in ASP.Net 2.0+


<edititemtemplate><asp:DropDownList ID="myDDL" Runat="server"
DataSourceID="myDataSet"
DataTextField="dtfield" DataValueField="dvfield"
SelectedValue='<%# Bind("data column to update") %>'>
</asp:DropDownList>
</EditItemTemplate>

No comments: