Hi guys, I am experiencing a weird error, I have an SfAutoComplete
<SfAutoComplete @ref="AutoCompleteCliente" TItem="ClienteDto" TValue="string" AllowFiltering="true" @bind-Value="@VM.ClienteId" DataSource="@VM.Clientes" Placeholder="Selecione el Cliente">
<AutoCompleteFieldSettings Value="ClienteId" Text="Nombre"></AutoCompleteFieldSettings>
<AutoCompleteEvents TItem="ClienteDto" TValue="string" Filtering="@OnFilteringClientes"></AutoCompleteEvents>
</SfAutoComplete>
This is my OnFilteringClientes event
private SfAutoComplete
public Query query;
private async Task OnFilteringClientes(FilteringEventArgs args)
{
args.PreventDefaultAction = true;
await VM.SearchClientes(args.Text);
query = new Query().Where(new WhereFilter()
{
Field = "Nombre",
value = args.Text,
Operator = "contains",
IgnoreCase = true
});
await this.AutoCompleteCliente.Filter(VM.Clientes, query);
}
The DataSource List and the ClientId variable are on a ViewModel
public string ClienteId { get; set; }
public List
Everything works great, but something weird happen when I write a Client name that is not on the list and then I go to another page and then return I got this error:
crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Arg_ObjObjEx
System.ArgumentException: Arg_ObjObjEx
at System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo culture, BindingFlags invokeAttr)
I'm not sure what I am doing wrong, thanks for your help
Thank you very much guys, I am gonna checkout the sample to see what I'm doing wrong.
Take care