Solved

Multiple Select on Drop Down List in VB.net

Posted on 2013-01-03
6
3,325 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
[X]
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
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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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

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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
System.net.Sockets Error 5 40
Access/Visual Basic Question 3 43
YouTube API get the Video Tags - vb.net 7 33
Convert VB web project to C# 3 42
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

730 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