Getting selectedvalue from dropdownlist when updating row


Joined
Nov 9, 2007
Messages
2
Reaction score
0
Hi, I have a gridview populated by a objectdatasource and in that i have a dropdownlist that populates with a sqldatasource when i 'edit'. Im having trouble getting the selectedvalue of the dll when i click 'update'. it looks like it repops the ddl before the gridview_update calls.

-------------------------------------
Dim ddlcontrol As DropDownList = GridView1.Rows.Item(E.RowIndex).FindControl("ddlAssignTo")
Dim select As String = ddlcontrol.SelectedItem.Value
-------------------------------------
<asp:TemplateField HeaderText="CurrentAssignment">
<ItemTemplate>
<%#Eval("CurrentAssignment")%>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="ddlAssignTo" runat="server" Width="152px" DataSourceID="SqlDataSource4" DataTextField="windowslogin" DataValueField="windowslogin" AutoPostBack="True"></asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>

I havent been able to bind the selectedvalue since im grabbing from 2 dbs and theyre unrelated.
 
Ad

Advertisements


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

Top