I am seeing some peculiar WebDropDown behaviour with the latest version of the WebDropDown. I have 3 values when my page loads. The default selection is the second one. When I select value 3 and click a search button on my page causing a postback, the dropdown correctly shows the selected item/value #3. Then, when I go back and reselect value #2, the postback indicates the old selected item/value of #3, yet the ActiveItemIndex shows the correct index for #2. Is this a bug, or am I just missing something here?
Thanks for your reply Valerie! I have looked at your example. I have set up the control in the same way that you have. However, I have more information after further debugging.
Even though I have set EnableMultipleSelection to false, every time I select a new value in my dropdown (not clicking CTRL or anything, just simply clicking a different value), I get another List element added to my dropdown.SelectedItems collection. The SelectedItem and SelectedValue reflect whatever the first item (index 0) is in this collection. So, if after reclicking on my original value, it is the second entry in dropdown.SelectedItems, so SelectedItem still has the value for the old item.
I don't want to keep a collection of anything - I just want the SelectedItem/Value to always be the last thing clicked on in the WebDropDown. How can I achieve this?
Hello ,
I created a sample and tested it based on the information you provided and the behavior was as expected. The selected item index matched the active item index. Please test this sample and see if it works on your end. If it works as expected compare the sample against your application to see what is different.
If the sample doesn't work as expected please provide me more details about your environment so I can test again.
Thanks,
Valerie
I have confirmed by debugging on the client-side that both get_activeItemIndex() and get_selectedItemIndex() have values of 1 indicating that the second value in dropdown is selected. When I click a search button on my page immediately afterwards, dropdown.ActiveItemIndex = 1 and dropdown.SelectedItemIndex = 2.