473,385 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

C# : ComboBox AutoComplete

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 5311
Plater
7,872 Expert 4TB
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
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 Expert 4TB
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
DropDownStyle has to be DropDownList
Feb 12 '08 #5
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
by: VM | last post by:
How can I implement the autocomplete functionality in a Windows comboBox? Thanks.
3
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. ...
19
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...
2
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...
2
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...
1
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...
4
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...
2
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
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...
0
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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,...

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.