Solved

Multiple Select on Drop Down List in VB.net

Posted on 2013-01-03
6
3,086 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Expando 4 47
Convert to Hour/minute textbox and compare 3 53
How do I return the next Alpha Character when a specific text string is found? 4 36
Getfiles in vb.net 28 43
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 …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

895 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

17 Experts available now in Live!

Get 1:1 Help Now