Aqeel
Aqeel

Reputation: 689

How can I select multiple values in dropdownList in asp.net with VB

I am creating a page in which I need to show a drop down List. From this drop down List a user can select multiple values. I know I could use a check box list like:

<asp:CheckBoxList ID="CheckBoxList1" runat="server" style="margin-right: 158px">
    <asp:ListItem>Value 1</asp:ListItem>
    <asp:ListItem>Value 2</asp:ListItem>
    <asp:ListItem>Value 3</asp:ListItem>
    <asp:ListItem>Value 4</asp:ListItem>
</asp:CheckBoxList>

but if there are more than 50 or so values then that will consume a lot of space on the page and will look odd. So kindly tell me how can I select multiple values from drop down list or if there any alternatives so that I can select multiple values and show many records on a minimum space but not a grid?

Upvotes: 0

Views: 16299

Answers (2)

Ravi Gadag
Ravi Gadag

Reputation: 15881

you can use List box control with the SelectionMode property set to Multpile. Listbox

if you need dropdownList only, then you can check this example Multi Select DropDown

Upvotes: 1

David Savage
David Savage

Reputation: 769

I think what you are looking for is a ListBox. What you will want to do is apply CSS to allow it to scroll horizontally.

Upvotes: 1

Related Questions