Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1410
Item selection in the webdropdown items list
posted

Hi.

I am using a webdropdown that has around 100 items in it. By default, on page-load, I want to select the first item in the list.

I am using

$find("webdropdown1").set_selectedItemIndex(0);

in client-side javascript. It is selecting the first item correctly. But when I open the dropdown, the first items does not show selection. The currently selected item should be highlighted in the dropdownlist. How to accomplish this?

For your Information, I have also tried :

$find("webdropdown1").set_selectedItemIndex(0, true);

but did not work.

Parents
  • 13438
    Suggested Answer
    posted

    Hello,

    Please take a look at the attached sample. It shows how to achieve your goals. You have to get an item and select/unselect it directly. Setting the index will not resolve the issue. Same would happen if you want to change the active item. Then you have to say item.activate/inactivate.

    Please let me know if the sample works for you.

    WDD.zip
Reply Children