Dear support,
I updated the SfComboBox nuget package to the latest version, version 20.3.0.47. I am using Xamarin forms version 5.0.0.2012. When I add items to the ObservableCollection which I binded to the DataSource property of the SfComboBox, there is an unhandled exception and the app crashes. The error details are:
System.ArgumentOutOfRangeException
Message=Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
I get the error when I do the following:
Class:
public class Test
{
public int ID { get; set; }
public string Description { get; set; }
}
In ViewModel:
private ObservableCollection<Test> list;
public ObservableCollection<Test> List
{
get { return list; }
set
{
list = value;
OnProperyChanged();
}
}
public ViewModel()
{
List = new ObservableCollection<Test>();
list.Add(new Test { ID = 1, Description = "Test" });
}
In XAML:
<inputLayout:SfTextInputLayout ContainerBackgroundColor="Transparent"
Hint="Test">
<combobox:SfComboBox ShowSuggestionsOnFocus="True"
HeightRequest="65"
BorderColor="Red"
DisplayMemberPath="Description"
SelectedValuePath="ID"
DataSource="{Binding List}"/>
</inputLayout:SfTextInputLayout>