We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Access multi selected values from dropdownlist and display to screen

Thread ID:





129262 Mar 8,2017 09:27 AM UTC Mar 10,2017 06:00 PM UTC LightSwitch HTML 3
Tags: DropDownList
Anya May Hope
Asked On March 8, 2017 09:27 AM UTC


I am currently using the multi selection dropdownlist. I have populated the list and selected 2 items. I would now like to press a button on my screen and display the items I have selected. (This is my first step towards using the dropdownlist to select multiple items and add them to a table.)

So far, I have managed to display the first selected item on my screen. I would now like to display all the selected items.

My dropdownlist is set up exactly as in the syncfusion documentation here: https://help.syncfusion.com/lightswitch/html-client/dropdownlist/multi-selection-modes
My current button code is this:

myapp.DisplayItems_execute = function (screen)
    //Read all the selected items in the drop down list
    var itemsDropdown = screen.findContentItem("ItemListBox");

    //take first selected item and output a property
    var selectedService = servicesDropdown.value.selectedItem;
    screen.TestString = selectedService.Id;

Thank you very much in advance,
Anya-May Hope

Karthikeyan Viswanathan [Syncfusion]
Replied On March 9, 2017 10:16 AM UTC

Hi Anya,    
Thanks for contacting Syncfusion support.  
 Yes, you can get the multiple selected items based on isChecked parameter. Please find to the code example:  
            change: function (args) {  
                if (servicesDropdown.value.selectedItem == nullservicesDropdown.value.selectedItem = [];  
                (args.isChecked) ? servicesDropdown.value.selectedItem.push(servicesDropdown.value.data[args.itemId]) :servicesDropdown.value.selectedItem.splice(servicesDropdown.value.selectedItem.indexOf(servicesDropdown.value.data[args.itemId]), 1);  
Karthikeyan V.  

Anya May Hope
Replied On March 9, 2017 10:42 AM UTC

Fantastic, just what I needed. Thankyou very much!

Gopi Govindasamy [Syncfusion]
Replied On March 10, 2017 06:00 PM UTC

Hi Anya,  
Most Welcome.  
Gopi G. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon