selecting dropdown elements programatically

Can we select /unselect dropdown elements programmatically (without user interaction with the control)?

I do not see any function in current API which supports this. 


1 Reply

PM Ponmani Murugaiyan Syncfusion Team January 20, 2022 05:20 AM UTC

Hi Prashant, 

You can programmatically select/unselect the items using the value property, in which you can select the item by adding the value or if you would like to unselect the specific item, you can remove that particular item from the array and update the remaining value. 

select() { 
    this.mulObj.value = ['DK', 'DE', 'FR', 'CA']; 
} 
unSelect() { 
    this.mulObj.value = ['DK', 'DE']; 
} 


Regards, 
Ponmani M 


Loader.
Up arrow icon