472,961 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

dropdownlist selectedindexchanged event not firing.. please help.


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 a handler
for the SelectedIndexChanged event.

The server control is instantiated upon every request.

It currently adds 2 items to the dropdownlist from the database.
The dropdownlist selected value is preserved across postbacks, but the event
is only fired when the 2nd item in the list is selected... I'm lost.. why
not the first?

Thanks in advance,
Stan

Nov 17 '05 #1
3 9725
Is it because the SelectedIndex to begin with is 0? So if you pick the first
item, the SelectedIndex doesn't change and the event won't fire. Can you set
the SelectedIndex to -1 when you load the dropdown?

I had the same problem once and that is how I got around it.

-Darrin
"DesignerX" <de********@yahoo.com> wrote in message
news:q4********************@giganews.com...

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 a handler for the SelectedIndexChanged event.

The server control is instantiated upon every request.

It currently adds 2 items to the dropdownlist from the database.
The dropdownlist selected value is preserved across postbacks, but the event is only fired when the 2nd item in the list is selected... I'm lost.. why
not the first?

Thanks in advance,
Stan


Nov 17 '05 #2
Is it because the SelectedIndex to begin with is 0? So if you pick the first
item, the SelectedIndex doesn't change and the event won't fire. Can you set
the SelectedIndex to -1 when you load the dropdown?

I had the same problem once and that is how I got around it.

-Darrin
"DesignerX" <de********@yahoo.com> wrote in message
news:q4********************@giganews.com...

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 a handler for the SelectedIndexChanged event.

The server control is instantiated upon every request.

It currently adds 2 items to the dropdownlist from the database.
The dropdownlist selected value is preserved across postbacks, but the event is only fired when the 2nd item in the list is selected... I'm lost.. why
not the first?

Thanks in advance,
Stan


Nov 17 '05 #3
I have the same problem. Even when I preset to select index to 2,3,4 etc
when rendering the page. Was your problem related to the fact the the select
index was initialzied to 0? Have you found a solution?

"DesignerX" <de********@yahoo.com> wrote in message
news:q4********************@giganews.com...

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 a handler for the SelectedIndexChanged event.

The server control is instantiated upon every request.

It currently adds 2 items to the dropdownlist from the database.
The dropdownlist selected value is preserved across postbacks, but the event is only fired when the 2nd item in the list is selected... I'm lost.. why
not the first?

Thanks in advance,
Stan


Nov 17 '05 #4

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

Similar topics

0
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...
1
by: ProSAAP | last post by:
I need help. I am attaching both the html stuff as well as the code snippet that is not firing. Can someone please help me Thank Sub InputPub_SelectedIndexChanged(ByVal sender As Object, ByVal e...
2
by: Shiju Poyilil | last post by:
Hi ! I have a requirement wherein i am binding a datalist which contains a label (Caption for the field) and some literal hidden fields and a dropdown list. When I am binding to the datalist.....
3
by: Lew Barnesson | last post by:
Hi All, I have looked and looked for an answer to the following problem (without success), and would be very grateful for a solution. The problem: The SelectedIndexChanged event code of an...
1
by: CurlyFro | last post by:
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...
11
by: Santosh | last post by:
Dear all , i am writting following code. if(Page.IsPostBack==false) { try { BindSectionDropDownlist();
2
by: jnoody | last post by:
The problem I am having is with the SelectedIndexChanged event not always firing or the SelectedIndex property not being correct when the event does fire. The code is below, but here are some...
7
by: Damien | last post by:
Hi guys, I'm trying to learn ASP.NET and got a problem with DroDownList... SelectedIndexChanged doesn't fire. Maybe you'll be able to suggest something. I think it may be connected with the...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.