471,108 Members | 1,372 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,108 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 9623
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by ProSAAP | last post: by
2 posts views Thread by Shiju Poyilil | last post: by
11 posts views Thread by Santosh | last post: by

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.