I have a winforms application in visual studio 2010.
On a form, I have a databound combobox, for which i have set autocompletesource=listitems and
autocompletemode=suggestappend.
Now For this functionality to work, I have set dropdownstyle=dropdown, so that user can type a text
But I want a user to be able to select only an item available from its dropdown.
If user enters item other than list items, and leaves combobox, user should not be able to leave combobox.
In short, I want user to be able to select item only from available listitems, not anything he enters.
plz help
If you set
DropDownStyle = DropDownListandAutoCompleteMode = Append, the user will still be able to type the value to select the item they want, but they will be limited to the items that are in the list.When
AutoCompleteMode = Append, it will check subsequent characters typed by appending them to the value being searched, as long as you type them quickly, that is. If you wait too long between key strokes, then it will go back to the first letter search again.Consider: do you really need them to be able to enter an invalid value just so you can alert them that it’s invalid? Because if not, it’s just more confusing that way. By giving them the opportunity to enter any value, it implies that they are allowed to do so.