.NET MAUI AutoComplete Methods
AutoComplete for .NET MAUI exposes the ability to explicitly show/hide the popup containing all items through the following methods:
-
ShowSuggesstions
—Shows all items when the control receives focus. -
HideSuggestions
—Hide all items when the control looses focus.
Example
The example below uses ShowSuggesstions
method to display all items as soon as the AutoComplete receives the focus.
1. Create the needed business objects, for example type Client with the following properties:
2. Define a ViewModel with a collection of Client objects:
3. Declare the RadAutoComplete in XAML:
4. Use the following code to attach the focused event to the control:
5. Call the ShowSuggestions
method inside the Focused event:
Here is the result: