By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,760 Members | 1,585 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,760 IT Pros & Developers. It's quick & easy.

Strange problem with dropdown list - always selects the first item

P: n/a
Hi All:

I'm having a strange problem with the dropdownlist. Here is what is

I have a webform on which I have a whole bunch of controls. The form has 2
dropdownlists. The dropdowns are bound. The items are loaded just fine into
the dropdown lists at the time of page load. When I try to select an item
from the dropdown list, it always ends up selecting the first item.

1. I have set the autopost back to true
2. The selectedindexchanged event does not fire.

Does anyone have any idea what is happening?

Jul 21 '05 #1
Share this Question
Share on Google+
3 Replies

P: n/a
Hi Vinay

I believe you are using something like this
ddlSubActivity.SelectedIndex = ddlSubActivity.Items.IndexOf(ddlSubActivity.Items. FindByValue(cstrSubActivityValue)
I believe you are populating the dropdowns in same functions
If so , try to use the above code after you have bound the second dropdown also. do not do immediately after bindin
the first dropdow


Jul 21 '05 #2

P: n/a
Hi Vinay,

Show some code maybe we can help you than better.

Jul 21 '05 #3

P: n/a
Hi Satish/Cor:

Thanks for trying to help. The problem was in my code. I am binding the ddl
to an arraylist that consists of objects. The class defn for that object was
messed up which led up to this - a typo was the culprit!

Thanks again :)


"Cor Ligthert" <no**********> wrote in message
Hi Vinay,

Show some code maybe we can help you than better.


Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.