We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to change suggestion mode based on search criteria?

Platform: Xamarin.Forms |
Control: SfAutoComplete

To change the Suggestion mode based on search criteria, follow the given steps:

Step 1: Create the AutoComplete sample and include the necessary source files.

Step 2: Create an instance for AutoComplete.

Step 3: Create an instance for List and populate it using Add() function.

Step 4: Then assign the populated list to AutoComplete’s AutoCompleSource property.

Step 5: By using the object you can change the suggestion display as follows:


public partial class AutoCompletePage : ContentPage    {        SfAutoComplete autoComplete;        public AutoCompletePage()        {            InitializeComponent();            autoComplete = new SfAutoComplete();           autoComplete .SuggestionMode = SuggestionMode.Contains;
            List<string> list = new List<string>();           list .Add("Afghanistan");
           list .Add("Akrotiri");
           list .Add("Albania");
           list .Add("Algeria");
            autoComplete.AutoCompleteSource = list;            StackLayout stack = new StackLayout();            stack.Children.Add(autoComplete);            this.Content = stack;        }    }


The following screenshot is an example to change the suggestion display mode:


F:\backup\carousel images\startswith.png


F:\backup\carousel images\swcs.png


F:\backup\carousel images\c.png


F:\backup\carousel images\cwcs.png


F:\backup\carousel images\eq.png


F:\backup\carousel images\eqwcs.png


F:\backup\carousel images\endw.png


F:\backup\carousel images\endwcs.png

2X faster development

The ultimate Xamarin UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile