Solved

Multiple Select on Drop Down List in VB.net

Posted on 2013-01-03
6
3,029 Views
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?
0
Comment
Question by:jeremyzit
  • 3
  • 2
6 Comments
 
LVL 21

Accepted Solution

by:
Craig Wagner earned 500 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.
0
 

Author Comment

by:jeremyzit
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?
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38742250
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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.
0
 

Author Comment

by:jeremyzit
ID: 38744117
CodeCruiser,

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

Thanks.
0
 
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.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

705 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now