New to Telerik UI for Xamarin? Download free 30-day trial

Remote Search

The Remote Search functionality of the RadAutoCompleteView control allows you to easily take the user input, trigger custom searching algorithm and assign the results to the ItemSource of the control.

  • LoadingTemplate (DataTemplate): Defines the loading message.

Implement your custom searching algorithm inside the body of the TextChanged event handler.


Here is an example how the RadAutoCompleteView Remote Search works:

First, create the needed business objects, for example type Client with the following properties:

public class Client
    public Client(string name, string email, string imageSource)
        this.Name = name;
        this.Email = email;
        this.ImageSource = imageSource;
    public string Name { get; set; }
    public string Email { get; set; }
    public string ImageSource { get; set; }

Then create a ViewModel with a collection of Client objects:

public class ViewModel
    public ObservableCollection<Client> Source { get; set; }
    public ViewModel()
        this.Source = new ObservableCollection<Client>()
            new Client("Freda Curtis", "", "available32.png"),
            new Client("Jeffery Francis", "", "away32.png"),
            new Client("Eva Lawson", "", "available32.png"),
            new Client("Emmett Santos", "", "busy32.png"),
            new Client("Theresa Bryan", "", "available32.png"),
            new Client("Jenny Fuller", "", "busy32.png"),
            new Client("Terrell Norris", "", "away32.png"),
            new Client("Eric Wheeler", "", "away32.png"),
            new Client("Nida Carty", "", "away32.png"),
            new Client("Niki Samaniego", "", "busy32.png")

Use the following snippet to declare a RadAutoCompleteView in XAML:

<telerikInput:RadAutoCompleteView x:Name="autoCompleteView"
                                  Watermark="Remote Search..."
            <StackLayout Orientation="Horizontal"
                         Margin="0, 20, 0, 20">
                <Label Text="Searching... " FontSize="16" TextColor="#8E8E93"/>
                <telerikPrimitives:RadBusyIndicator x:Name="busyIndicator" 
            <Label Text="No match was found for the specific search. Please try again."

Where you will need to add the following namespaces:


Create a custom searching algorithm and assign the result to the control's ItemsSource inside the TextChanged event handler:

public partial class RemoteSearch : ContentView
    private ViewModel viewModel;
    private string currentText;
    private bool  isRemoteSearchRunning;

    public RemoteSearch()

        this.viewModel = new ViewModel();
        this.BindingContext = viewModel;

    private void OnTextChanged(object sender, TextChangedEventArgs e)
        var autoCompleteView = (RadAutoCompleteView)sender;
        autoCompleteView.ItemsSource = null;

        this.currentText = e.NewTextValue ?? "";

        if (this.currentText.Length >= autoCompleteView.SearchThreshold && !this.isRemoteSearchRunning)
            this.isRemoteSearchRunning = true;
            Device.StartTimer(TimeSpan.FromMilliseconds(1500), () =>
                this.isRemoteSearchRunning = false;
                string searchText = this.currentText.ToLower();
                autoCompleteView.ItemsSource = this.viewModel.Source.Where(i => i.Name.ToLower().Contains(searchText));
                return false;

This is the result when LoadingTemplate is searching for results:

AutoCompleteView Remote Search Searching

This is the search complete results:

AutoCompleteView Remote Search Results

A sample Remote Search example can be found in the AutoCompleteView/Features folder of the SDK Samples Browser application.

See Also

In this article