Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Datalist changes impacting other controls in list

Reply
Thread Tools

Datalist changes impacting other controls in list

 
 
=?Utf-8?B?U2NvdHQgSw==?=
Guest
Posts: n/a
 
      03-08-2005
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Looks like cellphones are impacting all cameras Paul Ciszek Digital Photography 7 02-23-2013 06:15 AM
Re: Looks like cellphones are impacting all cameras Paul Ciszek Digital Photography 5 02-15-2013 05:31 PM
Setting up a datalist control - Item_DataBound for a datalist in a datalist Nevyn Twyll ASP .Net 8 09-09-2004 10:13 PM
LoadViewState works only when datagrid or datalist control not when TextBoxa and other server controls? SSW ASP .Net 2 11-12-2003 03:07 AM
LoadViewState works only when datagrid or datalist control not when TextBoxa and other server controls? SSW ASP .Net 0 11-11-2003 12:54 PM



Advertisments