Solved

How do I add a ComboBox to my ASP.NET 2.0 page ?  VB.NET ComboBox

Posted on 2007-04-11
5
961 Views
Last Modified: 2013-11-07
VB.NET, ASP.NET.  .NET 2.0

I guess this is an easy beginner question.  I can't find the ComboBox control.

How do I drop a ComboBox control to my ASP.NET page (with a VB.NET code behind page).  I tried going to chose Toolbox Items and all ComboBox controls were checked, but I don't see it.

Or what properites can make a DropDownList work like a ComboBox (so I can type in my own value)
0
Comment
Question by:Epicmanagement
5 Comments
 
LVL 12

Expert Comment

by:Pra4444
ID: 18893355
This is how you add values at run time...

DropDownList1.items.add("anyvalue")

if you know the values before then and its not gonna change then,
<asp:dropdownlist id="DropDownList1" runat="server"  Width="97px" Font-Bold="true">
                                          <asp:ListItem Value="1">text1</asp:ListItem>
                                          <asp:ListItem Value="2">text2</asp:ListItem>
                                          <asp:ListItem Value="3">text3</asp:ListItem>
                                    </asp:dropdownlist></td>
0
 
LVL 7

Expert Comment

by:MHenry
ID: 18893360
Did you try the drop down list in the toolbox? You can assign a label and a value.

Should work for you.

Best,
MH
0
 
LVL 17

Expert Comment

by:Elvio Lujan
ID: 18893363
the name of combobox in the toolbox is dropdownlist its the same
0
 

Author Comment

by:Epicmanagement
ID: 18894279
NO they are not the same.

It a Windows Application a Combo Box also lets you type in your own value so you don't have to just chose from the values in a dropdownlist.

I need the user to be able to also enter in a value that is not in the DropDown
0
 
LVL 35

Accepted Solution

by:
mrichmon earned 500 total points
ID: 18894707
There is no such thing.  You must write one or purchase one.

We wrote our own (C#)

Here is code for one as well (also in C#)
http://dotnetslackers.com/articles/aspnet/Custom_ASPNET_ComboxBox_Control.aspx

Here is another:
http://www.metabuilders.com/Tools/ComboBox.aspx
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
SlingPlayer alternatives 1 36
Name space syntax error 12 44
Export import database 4 45
Advice in Xamarin 21 57
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

863 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

23 Experts available now in Live!

Get 1:1 Help Now