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
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