RE: bind dropdown field in GridView EditItemTemplate?

G

Guest

The GridView will pass the LessorID as a parameter (in the NewValues
collection) if you create a 2-way databind on the dropdownlist:

<asp:DropDownList ID="ddlCompany" runat="server"
DataSourceID="sdsLessors" DataTextField="Company" DataValueField="LessorId"
SelectedValue='<%# Bind("LessorID") %>'>
</asp:DropDownList>

In addition, for good programming style, you should define an
<UpdateParameters> collection within the markup of the SqlDatasource that
updates the GridView.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,060
Latest member
BuyKetozenseACV

Latest Threads

Top