jesus4u
Jun 27th, 2003, 01:41 PM
I have a dropdown list inside the EditItemTemplate that I need to execute this code against. Problem is that the e can not find my control. What is up?
Sub Edit_Command(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs) Handles DataList1.EditCommand
DataList1.EditItemIndex = e.Item.ItemIndex
Dim dwntype As DropDownList
dwntype = CType(e.Item.FindControl("dwnType"), DropDownList)
dwntype.SelectedItem.Selected = False
Dim t As String = "Department Announcement"
dwntype.Items.FindByValue(t.ToString()).Selected = True
LoadData()
End Sub
Sub Edit_Command(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs) Handles DataList1.EditCommand
DataList1.EditItemIndex = e.Item.ItemIndex
Dim dwntype As DropDownList
dwntype = CType(e.Item.FindControl("dwnType"), DropDownList)
dwntype.SelectedItem.Selected = False
Dim t As String = "Department Announcement"
dwntype.Items.FindByValue(t.ToString()).Selected = True
LoadData()
End Sub