If you want to filter the suggestions based on what the user has entered in the text field you can use the exposed completion
mode has two options: SstartsWith
mode, the autocomplete shows only suggestions that start with the typed phrase.
mode, the autocomplete shows only suggestions that contain the typed phrase.
So using this feature will filter the suggestion without having to write extra code.Real life examples demonstrating the completion mode can be fond here (NativeScript core) and here (NativeScript Angular)
mode has three options: Suggest
More about how the different options works can be found in this article
(also real life examples can be found in our SDK application linked above in the previous examples).
Regarding the approach to manually set a default hint (placeholder) value for your text field n the AutoComplte (Android).
If you still need to assign an initial value to your text field that is part of the RadAutomCompleteTextView then you can access the native field and use the native methods to assign the initial value.
e.g. Let's assume that we are working with this example
First, we will need to access the loaded
event of our RadAutoCompleteTextView and provide callback
Now in the code-behind file, we can access the native view and use the native method setText to assign a default value.
autocmp = args.object;
nativeTField = autocmp.android.getTextField();
"Enter Country Name"
// default placeholder (hint) value
Now with setHint,
we have set a default hint (placeholder) for our RadAutoCompleteTextView.
The same way you can use the native methods you need (e.g. like setText or other methods) or overwrite the native textChange listeners as shown in my previous post.