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
1740
Multi-select checkbox with "All" option
posted

Hi Everyone,

I am looking to build a functionality of multi-select checkbox with "All" option. Selecting "All" should select all the available options in the WebDropDown and unselecting it should de-select all the options.

Is this a default feature of WebDropDown or do I have to write some code to achieve this functionality?

I will appreciate any help or ideas from the community!!

Thanks

Parents
No Data
Reply
  • 24671
    Suggested Answer
    posted

    Hi,

    This functionality is not supported out of the box, but it can be achieved by adding a "special" item to the dropdown that has the text "Select All", then enable multiple selection in the following way: EnableMultipleSelection=True, MultipleSelectionType=Checkbox. 

    After that you can handle the SelectionChaning/SelectionChanged events, and in the client side traverse all items and select them:

    for (var i=0; i< dropDown.getLength(); i++)

    {

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

           item.select();

    }

    Hope it helps. Let me or the Development Support group know if you have any further questions. 

    Angel

     

Children
No Data