Multiselect - How to programmatically control which boxes are checked and which ones are unchecked?

We are using a multiselect with checkboxes, in a form where some controls are supposed to depend on others.  Let's say the multiselect has 'animal', 'vegetable' and 'mineral'.  Our requrement is (a) when user selects a vegetable in another control, the 'vegetable' gets a check in its box in the multiselect and (b) when user unchecks for example 'mineral' in the multiselect, the list of minerals gets cleared in other elemement.

(b) is easy because the other element has a clear method.  But (a) is a problem, we have not found a way to select an item in the multiselect (that is, to put a check in its box) when some other event happens elsewhere.


1 Reply

UD UdhayaKumar Duraisamy Syncfusion Team November 13, 2023 11:08 AM UTC

For your requirement, you can try grouping functionalities of the MultiSelect in checkbox mode. Clicking the checkbox in a group will select all the items grouped under it. Please refer to the online demo and documentation shared below for more details.


 


Online Demo: https://ej2.syncfusion.com/angular/demos/#/material3/multi-select/grouping-with-checkbox


Documentation: https://ej2.syncfusion.com/angular/documentation/multi-select/grouping#grouping-with-checkbox


Loader.
Up arrow icon