ASP.NET MVC Two select2 items - only one is styled

330 views Asked by At

I have two select tags, they are different only where id is and Item 2 has multiselect (i don't know why because they are the same objects and first one is also multiselect), but only one is styled, what I'm doing wrong or what I have forgotten about?

This is how I see it:

Two select items, first is working

Item 1

     @Html.ListBoxFor(m => m.SelectedFunkcjaTechnicznaWBudownictwie, 
    Model.FunkcjaTechnicznaWBudownictwieLst, 
    new { id = "FunkcjaList", @class = "dropdown-1 select2 show-tick form-control-plaintext", 
    @data_live_search = "true" })

         <select class="dropdown-symbox select2 show-tick form-control-plaintext select2-hidden-accessible"
 data-live-search="true" id="FunkcjaList" multiple="" name="SelectedFunkcjaTechnicznaWBudownictwie"
 data-select2-id="FunkcjaList" tabindex="-1" aria-hidden="true">
            <option value="1" data-select2-id="6494">Kierownik budowy</option>
            <option value="2" data-select2-id="6495">projektant</option>
    ...more options...
            </select>

Item 2

         @Html.ListBoxFor(m => m.SelectedFunkcjaTechnicznaWBudownictwie, 
    Model.FunkcjaTechnicznaWBudownictwieLst, 
    new { id = "FunkcjaList2", @class = "dropdown-1 select2 show-tick form-control-plaintext",
     @data_live_search = "true" })


         <select class="dropdown-symbox select2 show-tick form-control-plaintext" 
data-live-search="true" id="FunkcjaList2" multiple="multiple" 
name="SelectedFunkcjaTechnicznaWBudownictwie">
            <option value="1">Kierownik budowy</option>
            <option value="2">projektant</option>
    ...more options...
            </select>
1

There are 1 answers

0
Serdar GUL On

I suppose that you didn't write same code for both listboxes You forgot multiple property Look at the screenshot

enter image description here