Datalist changes impacting other controls in list

G

Guest

I have a datalist which has an edititem template.
When the user is in edit mode (of the datalist) it shows a couple of text
boxes for editing as well as a drop down list box and has a label control.
When the user changes the item in the drop down list I would like to set the
labels text property to a different description.
My problem is I have the event that can be triggered when the Drop down
selected index changes but can't seem to get a reference to the data list
label control for that particular item being edited.
Here is an example of something of I have:

Within the edit item template of the data grid exists something like this :
<TR>
<TD>
<asp:label id="Label11" runat="server" Font-Underline="True" Width="104px"
Height="15px" Font-Size="X-Small">Chosen Title:</asp:label><BR>
<asp:dropdownlist id=ddlChosenTitle runat="server" Width="228px"
Height="25px" OnSelectedIndexChanged="dl_SelectedIndexChanged"
AutoPostBack="True" DataValueField="Title_ID" DataTextfield="Title"
Datasource="<%# GetTitles() %>"></asp:dropdownlist>
</TD>
<TD>
<asp:label id="lblProfDescr" runat="server" Font-Size="X-Small"></asp:label>
</TD>
</TR>

In the vb code behind is this event which fires when the ddl is changed:
I am having trouble using the find control method or other way to get a
reference the the lblProfDescr so I can set the text property

Public Sub dl_SelectedIndexChanged(ByVal Sender As Object, ByVal e As
System.EventArgs)
Dim lblDescr As Label
Try
Dim dl As DropDownList = CType(Sender, DropDownList) ' this
would get a reference to the DDL
'This is where I would like to get the reference to the specific label and
set/change its text property

Catch eMsg As Exception
'send message
End Try
End Sub
 

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,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top