This is a migrated thread and some comments may be shown as answers.

How to get id

5 Answers 896 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Ed
Top achievements
Rank 1
Iron
Veteran
Iron
Ed asked on 09 Feb 2020, 05:29 AM

In the example at the bottom of https://docs.telerik.com/blazor-ui/components/autocomplete/events, 

How would I get the id of the selected car in the Change event? Seems like all I get is the string value.

Thanks … Ed

 

5 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 09 Feb 2020, 09:05 AM

Hi Ed,

The following article explains how to get an entire model item from a dropdown selection: https://docs.telerik.com/blazor-ui/knowledge-base/dropdowns-get-model

The autocomplete (as noted in its documentation and the KB) is a free text input for the user, and the dropdown is only a set of text suggestions for the user, this is a key difference between that and other dropdowns - it is basically a textbox.

 

Regards,
Marin Bratanov
Progress Telerik

 UI for Blazor
0
Ed
Top achievements
Rank 1
Iron
Veteran
Iron
answered on 09 Feb 2020, 04:28 PM

It almost sounds like I should be using the dropdownlist instead. It kinda raises the question, why use an autocomplete in the firstplace if I can get the desired functionality out of a ddl?

Thanks … Ed

 

0
Marin Bratanov
Telerik team
answered on 10 Feb 2020, 08:44 AM

Hello Ed,

Most dropdowns have similarities and which one you would use is up to the particular needs and UX you want. Here are a couple of differences between the DropDownList and the AutoComplete:

  • the autocomplete value is always a string, while the ddl can also work with number values, guid and enums
  • the autocomplete is a free text input, like a simple <input> but with suggestions the user can pick from, while the ddl only allows choice from a predefined collection of options
  • the autocomplete offers filtering of the results, including custom filtering, while the dll (at this point) does not. When it does, the UX will be different - filtering in the dll is usually a filter textbox in the dropdown as opposed to typing directly in an input

 

Regards,
Marin Bratanov
Progress Telerik

 UI for Blazor
0
Diego Modolo
Top achievements
Rank 1
Iron
Iron
answered on 27 Apr 2020, 05:13 PM
I've tried to use the above example with AutoCompleteBox, but it does not have the TextField property. Is there another way of achieving the behavior without this property?
0
Marin Bratanov
Telerik team
answered on 27 Apr 2020, 06:43 PM

Hi Diego,

The auto complete component is a free text input with facilities for the end user, but it is only a text input. For your case, I suspect you will need a ComboBox. I suggest you review the AutoComplete documentation for more details, and especially the green box right after the screenshot: https://docs.telerik.com/blazor-ui/components/autocomplete/overview.

 

Regards,
Marin Bratanov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
AutoComplete
Asked by
Ed
Top achievements
Rank 1
Iron
Veteran
Iron
Answers by
Marin Bratanov
Telerik team
Ed
Top achievements
Rank 1
Iron
Veteran
Iron
Diego Modolo
Top achievements
Rank 1
Iron
Iron
Share this question
or