Thanks a lot for you help,
i'm using sfAutoComplete in our project, i have an observableCollection<MyModel> in my PageViewModel,
ObservableCollection<GeneralPractitioner> _DoctorsList = new ObservableCollection<GeneralPractitioner>() {
new GeneralPractitioner(){FirstName ="000000000000"},
new GeneralPractitioner(){FirstName ="22222222222"},
new GeneralPractitioner(){FirstName ="3333333333333"},
new GeneralPractitioner(){FirstName ="44444444"},};
public ObservableCollection<GeneralPractitioner> DoctorsList
{
get
{
return _DoctorsList;
}
set
{
_DoctorsList = value;
UpdateProperty(nameof(DoctorsList));
}
}
<autocomplete:SfAutoComplete
x:Name="autoComplete"
DataSource="{Binding DoctorsList}"
HeightRequest="40"
MinimumPrefixCharacters="2"
SelectedItem="{Binding Path=SearchFilter.SelectedDoctor}"
ShowBorder="False"
Watermark="{helpers:Translate SEARCH_DOCTOR}">
<autocomplete:SfAutoComplete.Behaviors>
<helpers:EventToCommandBehavior Command="{Binding DoctorSearchTextChangedCommand}" EventName="ValueChanged" />
</autocomplete:SfAutoComplete.Behaviors>
<autocomplete:SfAutoComplete.ItemTemplate>
<DataTemplate>
<StackLayout Padding="2,0,0,0" Orientation="Horizontal">
<Label
Text="{Binding Path=FirstName}"
VerticalOptions="Center"
WidthRequest="500" />
</StackLayout>
</DataTemplate>
</autocomplete:SfAutoComplete.ItemTemplate>
</autocomplete:SfAutoComplete>
in Android, it work perfectly, but in iOS it does not ( the listview of the autocomplete does not show anything ) .
but if for IOS, i set the list in the xaml like this, it works perfectly.
<autocomplete:SfAutoComplete x:Name="autoComplete"
HeightRequest="40">
<autocomplete:SfAutoComplete.AutoCompleteSource>
<ListCollection:List x:TypeArguments="x:String">
<x:String>India</x:String>
<x:String>Uganda</x:String>
<x:String>Ukraine</x:String>
<x:String>Canada</x:String>
<x:String>United Arab Emirates</x:String>
<x:String>France</x:String>
<x:String>United Kingdom</x:String>
<x:String>China</x:String>
<x:String>United States</x:String>
<x:String>Japan</x:String>
<x:String>Angola</x:String>
</ListCollection:List>
</autocomplete:SfAutoComplete.AutoCompleteSource>
</autocomplete:SfAutoComplete>i will be fetching the data from the web api.
Hi
Sir, Sfautomcomplete is not working with ItemTemplate in IOS. How can you not reproduce that i don't understand.
Hi Team,
We have reviewed your query, and it seems that the issue with the dropdown items not being shown when using ItemTemplate in iOS for the AutoComplete control. This issue occurs only when the DisplayMemberPath property is not set. We have created a sample in which the AutoComplete control is populated with data and the DisplayMemberPath property is set. Now, the issue is resolved, and the dropdown items are displayed correctly. Please review the sample and let us know the details.
Regards,
Ahamed Ali Nishad.
I tried the latest example and have to say it is still not working in iOS (v16.4)