)
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. (Last updated on: June 24, 2019).
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 |
Published Date: August 22, 2016 |
Last Revised Date: June 24, 2019

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:

C#

 
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:

StartsWith

F:\backup\carousel images\startswith.png

StartsWithCaseSensitive

F:\backup\carousel images\swcs.png

Contains

F:\backup\carousel images\c.png

ContainsWithCaseSensitive

F:\backup\carousel images\cwcs.png

Equals

F:\backup\carousel images\eq.png

EqualsWithCaseSensitive

F:\backup\carousel images\eqwcs.png

EndsWith

F:\backup\carousel images\endw.png

EndsWithCaseSensitive

F:\backup\carousel images\endwcs.png

2X faster development

The ultimate Xamarin UI toolkit to boost your development speed.
ADD COMMENT
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
Live Chat Icon