Datalist changes impacting other controls in list

Discussion in 'ASP .Net' started by =?Utf-8?B?U2NvdHQgSw==?=, Mar 8, 2005.

  1. 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
     
    =?Utf-8?B?U2NvdHQgSw==?=, Mar 8, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Antonio D'Ottavio
    Replies:
    2
    Views:
    2,156
    =?Utf-8?B?RWx0b24gVw==?=
    Sep 26, 2005
  2. Nevyn Twyll
    Replies:
    8
    Views:
    1,971
  3. Jeremy Bowers

    "Collapsing" a list into a list of changes

    Jeremy Bowers, Feb 4, 2005, in forum: Python
    Replies:
    42
    Views:
    878
    Raymond Hettinger
    Feb 9, 2005
  4. Vinki
    Replies:
    0
    Views:
    359
    Vinki
    May 2, 2008
  5. Antonio D'Ottavio
    Replies:
    0
    Views:
    114
    Antonio D'Ottavio
    Sep 26, 2005
Loading...

Share This Page