DropDownList Strange Behavior

P

PJ

I have several dropdownlist controls in a placeholder on my form. Certain
events will show this place holder and populate the values of the items
collection of the dropdownlist controls. A placeholder surrounds each
individual dropdownlist as well and will be set to false if the data for the
dropdownlist will not cause it to have more than one item. I create the
items manually...I don't use databinding and I set both the text and the
value of each listitem. The autopostback is not set, as the follows are
read during a command event for a button.

My problem is that the SelectedIndex of any of the dropdownlist controls, in
which the value has been changed, is always 1. If it hasn't been touched,
it will be 0. The .SelectedIndex and .SelectedItem properties will not
reflect the correct selection. As a test, a dropdownlist outside of the
placeholders, in which i enter the listitem controls directly on the aspx
page, is working fine.

Any one have any idea what is going on here? I've used dropdownlist
controls thousands of times w/out encountering this issue. I'm sure I've
used them inside placeholder controls before. Inspecting the Locals, I do
see that all of the items are present for each dropdownlist, it just seems
to be the selectedindex is off. I am not manipulating the lists in this
particular event at all. I really can't seem to figure this one out.

~TIA PJ
 

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

Forum statistics

Threads
473,792
Messages
2,569,639
Members
45,353
Latest member
RogerDoger

Latest Threads

Top