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 Add image and button in the Drop down items

Platform: Xamarin.Forms |
Control: SfAutoComplete

Syncfusion Autocomplete in Xamarin provides a support to add image and buttons in the popup.


To add image and button for drop down in Autocomplete follow the below given procedure:


Step 1: Create the autocomplete sample with all necessary assemblies refer.

Step 2: Add necessary images in the Drawable folder that has to be shown on to the drop-down list.

Step 3: Use the below code snippets as such to get the exact output.


The below code illustrates the way to achieve this.

Xaml Code:

  <DataTemplate x:Key="itemTemplate">
      <StackLayout Orientation="Horizontal" HorizontalOptions="CenterAndExpand" Padding="5,0,0,0" >
          <Image Source="{Binding Image}" HeightRequest="40" WidthRequest="40" Aspect="AspectFit"/>
          <Button Text="{Binding Label}" TextColor="Black" WidthRequest="200" />
<StackLayout Padding="50" >
  <autocomplete:SfAutoComplete x:Name="autocomplete" DisplayMemberPath="Label" MaximumDropDownHeight="260" DropDownItemHeight="50" ItemTemplate="{StaticResource itemTemplate}" DataSource="{Binding ItemsCollection}" HeightRequest="60" WidthRequest="400" />


Code Behind Code:

namespace Autocomplete
public partial class AutocompletePage : ContentPage
public AutocompletePage()
    autocomplete.BindingContext = new AutoCompleteViewModel();
public class AutoCompleteModel
    public AutoCompleteModel(string label, string imagestr)
        Label = label;
        Image = imagestr;
    private string _label;
    public string Label
        get { return _label; }
        set { _label = value; }
    private string _image;
    public string Image
        get { return _image; }
        set { _image = value; }
public class AutoCompleteViewModel
    public AutoCompleteViewModel()
        ItemsCollection.Add(new AutoCompleteModel("James", "image1.png"));
        ItemsCollection.Add(new AutoCompleteModel("Jaren", "image2.png"));
        ItemsCollection.Add(new AutoCompleteModel("Jarius", "image3.png"));
        ItemsCollection.Add(new AutoCompleteModel("Jasdeep", "image4.png"));
        ItemsCollection.Add(new AutoCompleteModel("Jasvir", "image5.png"));
    private ObservableCollection<AutoCompleteModel> itemsCollection = new ObservableCollection<AutoCompleteModel>();
    public ObservableCollection<AutoCompleteModel> ItemsCollection
        get { return itemsCollection; }
        set { itemsCollection = value; }




Image for Image and Button on Drop Down Items:





Add the required images in drawable folder (Android), Resources folder(iOS) and at project location for UWP.




Sample Link: Sample


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