Welcome to the Blazor feedback portal. We’re happy you’re here! If you have feedback on how to improve the Blazor, we’d love to hear it!>
Thanks for joining our community and helping improve Syncfusion products!
The following exception occurs when we type a custom value and press enter in allowCustom enabled autocomplete.
Error: System.MissingMethodException: No parameterless constructor defined for type 'SyncfusionBlazorWASMApp.Pages.Index+Order'.
Code:
@using Syncfusion.Blazor.DropDowns <SfAutoComplete TValue="string" TItem="Order" AllowCustom="true" Placeholder="e.g. Australia" @bind-Value="@AutoVal" DataSource="@Orders"> <AutoCompleteFieldSettings Value="CustomerID"></AutoCompleteFieldSettings> </SfAutoComplete> @code{ public List<Order> Orders { get; set; } public string AutoVal; protected override void OnInitialized() { Orders = Enumerable.Range(1, 5).Select(x => new Order(x, ValidValues[new Random().Next(ValidValues.Length)])).ToList(); }
public class Order { public Order(int orderId, string customerId) { OrderID = orderId; CustomerID = customerId; } public int? OrderID { get; set; } public string CustomerID { get; set; } } } |
Replication step:
1. Run the above code in a WASM app
2. Type “a” and press enter.
3. Check the browser console
Result: Exception is thrown
Expected: filtered items to be displayed without exception