dropdownlist selectedIndexChanged event not firing

G

Guest

i have a userControl (.ascx) that has a dropdownlist embedded in a datagrid.
the dropdownlist autopostback is set to true. why isn't the
selectedIndexChanged firing?

Private Sub grdNewVideos_ItemCreated(ByVal sender As Object, ByVal e
As System.Web.UI.WebControls.DataGridItemEventArgs) Handles
grdNewVideos.ItemCreated
If e.Item.ItemType = ListItemType.EditItem Then
AddHandler CType(e.Item.FindControl("ddlArtistNames"),
DropDownList).SelectedIndexChanged, AddressOf
ddlArtistNames_SelectedIndexChanged
End If
End Sub

Private Sub ddlArtistNames_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
grdNewVideos.SelectedIndexChanged
Dim artistName As String = CType(sender,
DropDownList).SelectedItem.Text
Dim lblArtistNames As Label

lblArtistNames =
CType(grdNewVideos.Items(grdNewVideos.EditItemIndex).FindControl("lblArtistNames "), Label)

ArtistNames += artistName

lblArtistNames .Text = ArtistNames
End Sub
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top