In order to add a new item to the Autocomplete control, use AllowAddNew and AddNewText API’s. AllowAddNew is used to allow or restrict the Autocomplete control from adding a new item to the list. It accepts Boolean value. By default, the value of the AllowAddNew property is false. You can set it to true to add new text in the Autocomplete control. An API called AddNewText is used to add new item to the list items. It accepts String value. By default, the value of the AddNewText API is Add New.
To add new text in the Autocomplete control, enable AllowAddNew API, so that you can add a new text to the Autocomplete text box. After setting the AllowAddNew API to true, add new text by using the API AddNewText.
Note: AddNewText can be used in the Visual mode only.
The sample is attached for adding text in the Autocomplete control and it can be downloaded from the following location.
Sample Location: Sample
In the attached sample, the AllowAddNew and AddNewText APIs are included. When you type the text that is not present in the list, it shows the text given in the AddNewText API.
After selecting the entered text in the Autocomplete popup, it is added in the Autocomplete control as shown in the following screenshot.
Thus, you can add text in the Autocomplete control.
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:|