Class AutocompleteFilterBehavior
Represents a filtering behavior for SfAutocomplete. Using the text entered in control, suggestion list gets created based on TextSearchMode. We can override this and show custom suggestions which gets loaded either asynchronously or synchronously.
Inheritance
System.Object
AutocompleteFilterBehavior
Implements
Namespace: Syncfusion.Maui.Inputs
Assembly: Syncfusion.Maui.Inputs.dll
Syntax
public class AutocompleteFilterBehavior : Object, IAutocompleteFilterBehavior
Remarks
By default, the suggestions gets loaded asynchronously.
Constructors
AutocompleteFilterBehavior()
Declaration
public AutocompleteFilterBehavior()
Methods
GetMatchingItemsAsync(SfAutocomplete, AutocompleteFilterInfo)
Gets the matching items based on typed text. These matching items can either be loaded asynchronously or synchronously.
Declaration
public virtual Task<object> GetMatchingItemsAsync(SfAutocomplete source, AutocompleteFilterInfo filterInfo)
Parameters
Type | Name | Description |
---|---|---|
SfAutocomplete | source | The Autocomplete control. |
AutocompleteFilterInfo | filterInfo | Contains details regarding search text of Autocomplete control. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Object> | The custom items source based on typed text. |
Remarks
To load asynchronously, return await Task.Run(...); To load synchronously, return await Task.FromResult(...);