View Single Post
  #2 (permalink)  
Old May 12th, 2008, 04:52 AM
richyrich's Avatar
richyrich richyrich is offline
Moderator


 
Join Date: Mar 2008
Location: Somewhere only we know...
Posts: 331
Thanks: 23
Thanked 26 Times in 26 Posts
Blog Entries: 1
Rep Power: 1
richyrich is on a distinguished road

Awards Showcase
Classic ASP JavaScript 
Total Awards: 2

Default

Think I've worked out a solution.

In the OnSelectedIndexChanged event, declare the dropdownlist as an object and then use the .parent method to go back up to the datalist item control.

Code:
Sub change_ddl_level(ByVal s As Object, ByVal e As EventArgs)
        Dim ddl_id As DropDownList = s
        Dim dlst_item As DataListItem = s.parent.parent 'this finds the datalist item
        Dim td_incrby_h As HtmlTableCell = dlst_item.FindControl("td_incrby_h")
        Dim td_incrby As HtmlTableCell = dlst_item.FindControl("td_incrby")
        If ddl_id.SelectedValue = "inc" Then
            td_incrby_h.Visible = True
            td_incrby.Visible = True
        Else
            td_incrby_h.Visible = False
            td_incrby.Visible = False
        End If
End Sub
Reply With Quote