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.
Unfortunately, activation email could not send to your email. Please try again.

How to get back the selections of 'multiselect' with checkboxes

Thread ID:

Created:

Updated:

Platform:

Replies:

127669 Dec 1,2016 10:04 AM Dec 6,2016 12:54 AM ASP.NET Core 5
loading
Tags: DropDownList
George Rossopoulos
Asked On December 1, 2016 10:04 AM

Hi

first of all the documentation link for dropdown List/Getting Started is 'page not found'

My dropdownlist is like
 <ej-drop-down-list id="id1"  ej-for="strBands" datasource=@Model.Bands show-checkbox="true" width="100%" watermark-text="Select the bands you need">
                                <e-drop-down-list-fields selected=@Model.strBands  id="dxid" text="display" value="value" />
                            </ej-drop-down-list>

strBands is a string and returns only the first selection.

Model.Bands in controller is
  public class BANDS
        {
            public BANDS ini(string strdisp, string strval)
            {
                display = strdisp;
                value = strval;
                return this;
            }
            public string display { get; set; }
            public string value { get; set; }
        }

Thank you in advance for the help
Geirge

Karthikeyan Viswanathan [Syncfusion]
Replied On December 2, 2016 07:52 AM

Hi George, 
  
 Thanks for contacting syncfusion support. 
Sorry for this inconvenience caused. We have refresh the online documentation for dropdownlist. Please refer the link: https://help.syncfusion.com/aspnet-core/dropdownlist/getting-started 
 You can pass a value field data into ej-for.  For an example : You have display & value property data. You can pass a value property data into strBands.It will be set at initial time. We have prepared a sample based on your requirement. 
Please refer the sample link:  
Regards, 
Karthikeyan V. 


George Rossopoulos
Replied On December 2, 2016 01:04 PM

Hi Karthikeyan

thank you for your prompt reply. The problem i have is that this dropdown is in a form when the form submit then the strBands string has only the first selected item of the dropdown which is multiselect and the user may select even all its items.
In other words i want to have in the controller all the text that the dropdown displays e.g (as per your example) "Audi S6,Austin-žHealey,Ferrari š360"

thank you

George

Karthikeyan Viswanathan [Syncfusion]
Replied On December 5, 2016 03:22 AM

Hi George,  
   
 Thanks for your response.  
Query: when the form submit then the strBands string has only the first selected item of the dropdown in multiselection. 
 
When multiselection the DropDownList returns collection of list data into form post method. You can retrieve the selected data using List<datatype> and model name. Please refer the below code snippet: 
 
<code> 
public IActionResult Index(List<string> strBands) 
        { 
            .... 
       } 
</code> 
 
 
Refer the sample link:  sample  
 
Regards,  
Karthikeyan V.  


George Rossopoulos
Replied On December 5, 2016 10:29 AM

Hi Karthikeyan 

Thank you!!!! Worked Ok now.
You should add this in the (poor) 'asp.net code' documentation.

Thank you
George

Karthikeyan Viswanathan [Syncfusion]
Replied On December 6, 2016 12:54 AM

Hi George, 
Thanks for the update. 
We are glad the suggestion helped you to achieve your requirement. Sorry for this lack of information in help documentation. We consider your request.
Please let us know if you need further assistance. 
Regards,  
Karthikeyan V.


CONFIRMATION

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.

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.

;