Place only one item per line in a Listbox

Asked

Viewed 53 times

1

my listbox is putting two or more items in the same row when it fits. How can I force it to put an item per line? Follow the code below:

html

  <asp:ListBox ID="OC02_SERV_SOL"  runat="server" SelectionMode="Multiple" 
    DataValueField="COD_SERV_SOLIC" DataTextField="COD_SERV_SOLIC" > </asp:ListBox>

javascript

   $(function () {
        $('[id*=OC02_SERV_SOL]').multiselect({
            includeSelectAllOption: true

        });

    });

in Class

     var solic = filtro.Select(x => new { x.COD_SERV_SOLIC }).OrderBy(x => 
       x.COD_SERV_SOLIC).Distinct().ToList();                           

      OC02_SERV_SOL.DataSource = solic;
      OC02_SERV_SOL.databind();

Como está exibindo

Thank you!

1 answer

2


You should be able to resolve the situation with CSS only. You must change the display of each item to display: block.

  • worked, thank you very much!!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.