AutoComplete selected value

I don't know if I misunderstand the AutoComplete component.
When I try it on the website it looks like i get the value I select in the dropdown.
But when I do the same in my site I get the text I write in it back in the Change event.
Am I using it wrong or do I misunderstand how it is used?

<RadzenAutoComplete Data="@searchItems"
@bind-Value="ClearSearchText"
TextProperty="Title"
LoadData="@LoadData"
Style="width:100px;"
class="form-control-md"
Placeholder="Search"
MouseEnter="(args => ShowTooltip(args))"
Change="@(args => Change(args))" />

So this might be the reason.
If I have Change="@(args => Change(args))" it works diffrently then if I write Change="@Change".
The first seems to only sen back what I wrote and the second seems to send back the text I selected in the dropdown or the text I wrote if I click enter after typing.

1 Like

For what it's worth -- using "ValueChanged" worked for me.

The method I'm going to send you is quite handy and effective; you can receive the 'value' in the format provided below.



 <RadzenAutoComplete TextProperty="Title"
                     Style="width: 100%" Data="Articles" LoadData="args=>Search(args.Filter)">
     <Template>

         <RadzenButton Text="@((context as ArticleDto).Title)" Click="()=>GoToArticle((context as ArticleDto))" />
     </Template>
 </RadzenAutoComplete>
1 Like