Multiple Select on Drop Down List in VB.net

Posted on 2013-01-03
Medium Priority
Last Modified: 2013-01-04
When I was just about done with the project, they changed there mind and want to be able to select multiple items in the drop down list. Is there an easy way to allow this or do I need to use a List box? I've got 30 drop down list so if I can make an easy change that would be great otherwise, how do you add items to the list box and only show 1 item with scrolling options?
Question by:jeremyzit
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 21

Accepted Solution

Craig Wagner earned 1500 total points
ID: 38742173
I'm assuming this is a WebForms app.

The DropDownList control doesn't allow multiple selection. You'll need to change to a ListBox. You can show only one item at a time by setting the Rows property to 1. Honestly though, doing that is going to tick off your users because it's going to make it very difficult for them to tell which item(s) they've selected in the list.

Author Comment

ID: 38742187
Is there a way to make it look like a Drop Down list so that when you select the field it shows 5 items with scrolling like a drop down?
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 21

Expert Comment

by:Craig Wagner
ID: 38742251
Is there a way to make it look like a Drop Down list so that when you select the field it shows 5 items with scrolling like a drop down?

And allows multiple selection? Not that I know of. You'd probably have to build your own control, which seems like a whole lot more work than changing the UI to accommodate a ListBox.

Author Comment

ID: 38744117

Those look like good examples, but my code is in VB not C#. Do you have any examples in VB?

LVL 21

Expert Comment

by:Craig Wagner
ID: 38744178
It really shouldn't be that hard to convert the code from C# to VB.NET. It doesn't hurt to be familiar with the syntax of both languages and be able to at least read them and figure out what they're doing as a lot of code examples on the internet will be in C#.

Or you could just include the C# code in a separate class library project.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month10 days, 10 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question