473,327 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

dropdownlist selectedIndexChanged event not firing

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.EditItemInde x).FindControl("lblArtistNames "), Label)

ArtistNames += artistName

lblArtistNames .Text = ArtistNames
End Sub
Nov 19 '05 #1
1 3179
i wasn't testing the

If Not IsPostBack Then in the Page_Load before databinding.

"CurlyFro" wrote:
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.EditItemInde x).FindControl("lblArtistNames "), Label)

ArtistNames += artistName

lblArtistNames .Text = ArtistNames
End Sub

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Robert Hanson | last post by:
I am trying to get the newly selected item in the dropdownlist control from the SelectedIndexChanged event. The event is working fine, but I am still getting the originally selected item in the...
3
by: DesignerX | last post by:
I have a dynamically created composite server control. The composite control contains a dropdownlist, a validator and a label. I have the dropdownlist AutoPostBack set to true and have defined...
2
by: Paul Lacey | last post by:
When dynamically placing dropdownlists inside a panel, the dropdownlist's SelectedIndexChanged event doesn't fire. If you take the dropdownlist out of the panel it works properly. Autopostback is...
4
by: George | last post by:
I'm using .NET framework 1.1 and VS.NET 2003 for a aspx web form. There is a DropDwonList on the page and its SelectedIndexChanged event is fired to the server normally, until when I add another...
0
by: aboivin | last post by:
Hi, I've seen this posted many times but still can't find any answer. I have a number of ddl in my form and only one of them has the SelectedIndexChanged Event fired correctly even if they all...
2
by: Chris Lane | last post by:
Hi, I have a web control button that I use for submitting a form, for some reason this causes a dropdownlist web control I have in a panel at the top of the form to execute it's selected index...
3
by: amanbindal | last post by:
How to fire Dropdownlist selectedindexchanged event in JAVASCRIPT? Actually i want that on Dropdownlist selectedindexchanged event i got displayed data from a XML file.....!!
3
by: aqua62 | last post by:
all the dropdownlist in my form are of cascading type, where result of previous determines the data to be filled in the next . The problem is that if there is only 1 item in the dropdownlist then...
3
by: E. Kwong | last post by:
I have a DropDownList which is originally bound to a SqlDataSource. In Design view, the control is shown as "Databound". Later I changed my mind and changed the dropdown binded to a datatable...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.