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

DataGrid Dropdownlist SelectedValue in EditItemTemplate

Status
Not open for further replies.

bubberz

Programmer
Dec 23, 2004
117
US
<asp:TemplateColumn HeaderText="PCode">
<ItemTemplate>
<asp:Label id=Label7 runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.P3ResourceCode") %>'>
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList id=ddlP3 runat="server" Font-Size="7pt" Width="232px" DataSource="<%# DsC1 %>" DataMember="RTble" DataTextField="Expr1" DataValueField="RES" AutoPostBack="True">
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateColumn>

My issue is when I change this dropdownlist, how can I pull the selected value from the list? This dropdownlist isn't seen as an available control in the aspx.vb page.
 
Use the FindControl method

--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
ca*msm,

I tried in the Page_Load handler
...on PostBack
Dim ddlP3 As New DropDownList
DataGrid1.FindControl("ddlP3")
lblddlP3change.Text = ddlP3.SelectedValue.ToString()

I can't get the ldlddlP3change.Text value to change.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top