5 Answers, 1 is accepted
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.
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
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
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.
Our thoughts here at Progress are with those affected by the outbreak.