a) Ios 14.3
b) Nugget 18.4.0.32
1) Mainpage.Xaml
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:combobox="clr-namespace:Syncfusion.XForms.ComboBox;assembly=Syncfusion.SfComboBox.XForms"
xmlns:ListCollection="clr-namespace:System.Collections.Generic;assembly=mscorlib"
xmlns:local="clr-namespace:ComboBox_MultiSelection"
x:Class="ComboBox_MultiSelection.MainPage">
<ContentPage.BindingContext>
<local:EmployeeViewModel/>
</ContentPage.BindingContext>
<StackLayout
VerticalOptions="Start"
HorizontalOptions="Start"
Padding="30">
<Button Text="Clear" Clicked="Btn_Clicked" HorizontalOptions="Center" VerticalOptions="Center"/>
<combobox:SfComboBox
HeightRequest="40"
x:Name="comboBox"
DisplayMemberPath="Name"
IsEditableMode="True"
AllowFiltering="True"
SuggestionMode="Contains"
Watermark="Search...."
TextHighlightMode="MultipleOccurrence"
HighlightedTextColor="Red"
HighlightedTextFontAttributes="Bold"
NoResultsFoundText="Material not in the list"
SelectedValuePath="ID"
DataSource="{Binding EmployeeCollection}">
<combobox:SfComboBox.ItemTemplate>
<DataTemplate>
<StackLayout Orientation="Horizontal">
<Label Text="{Binding Name}" FontSize="Medium"/>
</StackLayout>
</DataTemplate>
</combobox:SfComboBox.ItemTemplate>
</combobox:SfComboBox>
</StackLayout>
</ContentPage>
2) Mainpage.cs
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace ComboBox_MultiSelection
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
private void Btn_Clicked(object sender, EventArgs e)
{
comboBox.Clear();
}
}
public class Employee
{
private int id;
public int ID
{
get { return id; }
set { id = value; }
}
private string name;
public string Name
{
get { return name; }
set { name = value; }
}
}
public class EmployeeViewModel
{
private ObservableCollection<Employee> employeeCollection;
public ObservableCollection<Employee> EmployeeCollection
{
get { return employeeCollection; }
set { employeeCollection = value; }
}
public EmployeeViewModel()
{
employeeCollection = new ObservableCollection<Employee>();
employeeCollection.Add(new Employee() { ID = 1, Name = "Frank" });
employeeCollection.Add(new Employee() { ID = 2, Name = "James" });
employeeCollection.Add(new Employee() { ID = 3, Name = "Steve" });
employeeCollection.Add(new Employee() { ID = 4, Name = "Lucas" });
employeeCollection.Add(new Employee() { ID = 5, Name = "Mark" });
employeeCollection.Add(new Employee() { ID = 6, Name = "Michael" });
employeeCollection.Add(new Employee() { ID = 7, Name = "Aldrin" });
employeeCollection.Add(new Employee() { ID = 8, Name = "Jack" });
employeeCollection.Add(new Employee() { ID = 9, Name = "Howard" });
}
}
}