Dropdown Combobox Predictive Text
Hi All
I have 2 questions.
Question 1:
I have a combobox and have 10 items in it (Name of countries).
I want to make the users life easy so that when they click inside the combobox and start writing then the text box will start predicting the rest of the text in the combo box. i.e. if i start writing "U" then the textbox will start predicting "UK" as "UK" is already a pre-populated item in the combobox.
Question 2:
How can i restrict the user from selecting only values within the pre-populated items of the combobox. Bearing in mind the combobox allows the user to write inside it (for the benefit of predictive text). But lets say there are values of UK, USA then I dont want the combobox to accept the value of "Ukraine" when the user clicks away from the combobox.
Any ideas?
Thanks
Re: Dropdown Combobox Predictive Text
Set the ComboBox.DropDownStyle=DropDownList.
This will force the user to select only item from list.
Re: Dropdown Combobox Predictive Text
Quote:
Originally Posted by
danasegarane
Set the ComboBox.DropDownStyle=DropDownList.
This will force the user to select only item from list.
But this will stop the predictive text as i explained in Question 1
Re: Dropdown Combobox Predictive Text
Then Populate the values of the items in combo box . And use this collection to create the
AutoCompleteSource Property to Custom
Then set the AutoCompleteMode Property to Suggest , and set the AutoCompleteCustomSource as your collections.
For checking the items it currently checked, check the selected index property of the combox. If any thing is selected from items in the Combox, then it will be > -1 , where 0 is the first item.
MSDN Example for Auto Suggest
Re: Dropdown Combobox Predictive Text
Quote:
Originally Posted by
danasegarane
Then Populate the values of the items in combo box . And use this collection to create the
AutoCompleteSource Property to Custom
Then set the AutoCompleteMode Property to Suggest , and set the AutoCompleteCustomSource as your collections.
For checking the items it currently checked, check the selected index property of the combox. If any thing is selected from items in the Combox, then it will be > -1 , where 0 is the first item.
MSDN Example for Auto Suggest
Many thanks
Re: Dropdown Combobox Predictive Text
Another alternative you might want to consider would be a list box, rather than a combo box.