Try below code with and without the AloowFiltering attribute.
@using Syncfusion.Blazor.DropDowns
@code {
protected SfComboBox theComboBox;
public class Countries
{
public string Name { get; set; }
public string Code { get; set; }
}
List Country = new List
{
new Countries() { Name = "Australia", Code = "AU" },
new Countries() { Name = "Bermuda", Code = "BM" },
new Countries() { Name = "Canada", Code = "CA" },
new Countries() { Name = "Cameroon", Code = "CM" },
new Countries() { Name = "Denmark", Code = "DK" },
new Countries() { Name = "France", Code = "FR" },
new Countries() { Name = "Finland", Code = "FI" },
new Countries() { Name = "Germany", Code = "DE" },
new Countries() { Name = "Greenland", Code = "GL" },
new Countries() { Name = "Hong Kong", Code = "HK" },
new Countries() { Name = "India", Code = "IN" },
new Countries() { Name = "Italy", Code = "IT" },
new Countries() { Name = "Japan", Code = "JP" },
new Countries() { Name = "Mexico", Code = "MX" },
new Countries() { Name = "Norway", Code = "NO" },
new Countries() { Name = "Poland", Code = "PL" },
new Countries() { Name = "Switzerland", Code = "CH" },
new Countries() { Name = "United Kingdom", Code = "GB" },
new Countries() { Name = "United States", Code = "US" },
};
protected void OnInitialized()
{
theComboBox.Clear();
}
protected void ValueChange(Syncfusion.Blazor.DropDowns.ChangeEventArgs args)
{
Console.WriteLine($"ValueChange: {args.ItemData ?? "ITS NULL"} - {args.Value}");
theComboBox.Clear();
}
protected void OnValueSelect(SelectEventArgs args)
{
Console.WriteLine($"OnValueSelect: {args.ItemData ?? "ITS NULL"}");
theComboBox.Clear();
}
}
Click into the combo box and type "camer" which will filter for Cameroon. Click on the entry from the list or hit enter.
Without the allowfilter=yes, args.ItemData will be populated. With it turned on, it is null.
This is a change since .44.