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

Hello, I have a datalist on a web 3

Status
Not open for further replies.

ksbrace

Programmer
May 13, 2000
501
US
Hello, I have a datalist on a web form and I am trying to reference the listbox within the datalist. I am pretty sure I want to use FindControl, but I keep coming up with Nothing being returned from:
Code:
Private Sub DataList1_EditCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs) Handles DataList1.EditCommand
        DataList1.EditItemIndex = e.Item.ItemIndex
        DataList1.ShowFooter = False
        lstDetectionFactor = CType(e.Item.FindControl("lstEditDetectionFactor"), DropDownList)
End Sub

Thanks in advance!
 
try something like this

lstDetectionFactor = CType(DataList1.Items(e.Item.ItemIndex).FindControl("lstEditDetectionFactor"), DropDownList)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top