Solved

Multiple Select on Drop Down List in VB.net

Posted on 2013-01-03
6
3,169 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

831 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