Hi
I am trying use the component RadzenAutoComplete in C#.
I would like in RadzenAtuoComplete the same function 'AllowClear' like in Drop Down.
I added a button behind the RadzenAutoComplete,
If I press the button, I cannot set the focus in RadzenAutoCompolete.
I tried this code, but this does not work:
<RadzenAutoComplete
id="SearchProduct"
Name ="SearchProduct"
Data=@productData
TextProperty="All"
Placeholder="@SelectProductLabel"
@bind-Value="@headerItem.ProductSearch"
LoadData=@OnLoadProductData
Change=@(args => OnChange(args, "SearchProduct"))> </RadzenAutoComplete>
<RadzenButton
Icon ="close"
ButtonStyle="ButtonStyle.Light"
Click=@(args => OnClick("SearchProductClear"))>
</RadzenButton>
protected async Task OnClick(string name)
{
await JSInterop.InvokeVoidAsync("eval", @"document.getElementById(""SearchProduct"").focus()");
StateHasChanged();
}
Thank you
David