473,545 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C# : ComboBox AutoComplete

8 New Member
Hey,

I've a comboBox with some List Items (countries names)
I was wondering how can I force the user to select those countries which are Listed in the collection list only, without any opportunity to add his own item

10X
Feb 12 '08 #1
5 5324
Plater
7,872 Recognized Expert Expert
Change the combobox style to that of only allows what is in it. It's an option on the property page.
Feb 12 '08 #2
igalep132
8 New Member
Change the combobox style to that of only allows what is in it. It's an option on the property page.
tanx for quick answer,
which property is it ?
I've tried all properties which consider Item/Collection but non of the is suitable

10X again
Feb 12 '08 #3
Plater
7,872 Recognized Expert Expert
It's not what you would think :-D
The property is called 'DropDownStyle'
Changing the value to 'DropDownList' will limit the control to what is in it's list (Making it behave like a listbox).

If you don't want to dissallow like that, there is also a method of checking to see if the selected index is not -1.
If you populate the combobox with values and have the auto-complete on, if someone types in something not in the list, the selected index will be -1, if they typed in something that IS in the list, the combo box automatically moves to select it and the selectedindex will have a >-1 value
Feb 12 '08 #4
dzenanz
45 New Member
DropDownStyle has to be DropDownList
Feb 12 '08 #5
SPrerna
2 New Member
Hello Plater ,

Thank you so much for the solution..i was trapped into this problem. I am new for asp.net.Once again thanx .
Oct 11 '12 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
10624
by: VM | last post by:
How can I implement the autocomplete functionality in a Windows comboBox? Thanks.
3
2225
by: RajW | last post by:
Is it possible to have an auto complete ComboBox in ASP.NET? I would like to create a ComboBox that functions similarly to the way that IE will try to autocomplete a URL as you type it in. Thanks, /*Raj*/
19
18301
by: Bernie Yaeger | last post by:
Everyone misses the point on this - what we need is a combobox autocomplete that is a dropdownlist only. When in dropdown mode, you can enter text - making that autocomplete is trivial. But when you look at combobox controls from years ago, they would autocomplete in dropdownlist mode. And if you look at intellisense, this is exactly what...
2
1629
by: Becker | last post by:
I have a need for a simple combobox on a form in one of my programs that represents city, state. I want to have it autocomplete as the user types. I have a table with these values (about 50k of them) and I'd like to source it from there. I have seen some methods out there for the autocomplete, but I think that pulling 50k in the combobox...
2
2214
by: Kalvin | last post by:
I found some code in Google, don't remember where, for an AutoComplete combobox. Everything is great with it except for one thing. If I use the mouse to drop the list down, then start typing to find the item in the list, the visible text changes, but the values of me.Text and Mybase.Text do not change. If you use the mouse and actually...
1
4321
by: David Tilman | last post by:
I'm working with C# in Visual Studio 2005. I have a combobox with AutoCompleteSource = ListItems and DropDownStyle = DropDown. I want users to be able to type in the combobox and the control to autocomplete (Append AutoCompleteMode), but have their options limited to the control's ListItems. Right now the autocomplete works fine, but they can...
4
5093
by: =?Utf-8?B?UmljaA==?= | last post by:
Greetings, I have to load 30,000 unique names into a combox. Filling a dataTable takes only a few milliseconds. But populating the combobox and displaying the list takes several seconds - way too long. A user selects a name from the combobox and runs a query. Originally, this combox was on a form in an MS Access ADP which was linked...
2
3113
by: dneupane | last post by:
Hi all How can I get combobox autocomplete working with button click event, my application cannot use keyboard, so I have soft keypad. Any help would be greatly appreciated. Regards Niju
6
7312
by: ezyeric13 | last post by:
I have a series of ComboBox's Bound to a DataGridView and I turned the AutoComplete on for them so they list all the items in a certain collumn of the DataGridView. The problem is that when you use the Tab key to finish the Autocomplete it both selects that item and moves to the next Control in the Tab Order. I personally prefer to use...
0
2423
by: =?Utf-8?B?UiBSZXllcw==?= | last post by:
Hi - I've been searching around for a fix but can't find one... There is a bug with combobox autocomplete suggestappend. When text has a slash, "ab/cd" for example, the autocomplete feature cuts off all text after the slash, "ab". Also, the autocomplete feature doesn't work correctly. It will not suggestappend when typing letters up to...
0
7475
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7409
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7664
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7918
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7436
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7766
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5981
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5341
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.