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
500
Clear Multi-Select WebDropDown Client Side
posted

Hi,

 

I have  a webdropdown with enable multiple selection  set to true. I want to clear the checked chekboxes within the drop down on rthe client side using Javascript. I referred to http://community.infragistics.com/forums/p/30177/161244.aspx#161244 which shows how to do this for a single selection dropdown.

how do I clear the multi-select dropdown and reset the current value to say "select"?

This is the code from the other post for single selectio which does not work for the multi-select.

<script type="text/javascript">

        function clearSelection() {

 

            var dropDown = $find("WebDropDown1");

            var item = dropDown.get_items().getItem(dropDown.get_selectedItemIndex());

            if (item != null) {

 

                item.unselect();

                item.inactivate();

                // optionally, clear input text

                // dropDown.set_currentValue("",true);

            }

            return false;

 

        }

 

Thank you.