# Autocomplete - Get Object in Data List

**URL:** <https://forum.radzen.com/t/autocomplete-get-object-in-data-list/6705>\
**Category:** Radzen.Blazor Components\
**Created:** [February 16, 2021, 5:24pm UTC](https://forum.radzen.com/t/autocomplete-get-object-in-data-list/6705 "2021-02-16T17:24:12Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![cjones](https://forum.radzen.com/letter_avatar_proxy/v4/letter/c/94ad74/32.png) [@cjones](https://forum.radzen.com/u/cjones)\
**Post date:** [February 16, 2021, 5:24pm UTC](https://forum.radzen.com/t/autocomplete-get-object-in-data-list/6705/1 "2021-02-16T17:24:12Z")

</div>

Just like the autocomplete demo, I have an autocomplete with data comprised of a set of objects. However, unlike the demo, where just the string typed into the autocomplete is returned upon selection, I need to get the whole object. (Using the demo as an example, I would like to get the whole Customer object and not just the company name.) If I were using a dropdown or one of the other controls, I would just set the value property or bind the value to a selected object, but neither of these seem to work with the autocomplete component (no value property and get casting errors when I bind-value/bind-SelectedItem to an object).

Is there a way to get the whole object while using autocomplete, or is doing so beyond the scope of the component?

Thanks in advance for any assistance you can provide me on this issue.

---

<div class="post-metadata">

**Author:** ![korchev](https://forum.radzen.com/user_avatar/forum.radzen.com/korchev/32/4_2.png) [@korchev](https://forum.radzen.com/u/korchev)\
**Post date:** [February 16, 2021, 5:50pm UTC](https://forum.radzen.com/t/autocomplete-get-object-in-data-list/6705/2 "2021-02-16T17:50:43Z")

</div>

Indeed the Autocomplete provides only the value of the property specified via TextProperty. It does not currently provide the "whole" object. You can use the DropDown instead with filtering enabled.

---

<div class="post-metadata">

**Author:** ![manu](https://forum.radzen.com/letter_avatar_proxy/v4/letter/m/7c8e57/32.png) [@manu](https://forum.radzen.com/u/manu)\
**Post date:** [May 13, 2021, 4:14pm UTC](https://forum.radzen.com/t/autocomplete-get-object-in-data-list/6705/3 "2021-05-13T16:14:24Z")

</div>

I don't understand why you don't add a SelectedItem property (and maybe an IdProperty) to make the control a lot more usable. There are code systems where the displayed values are similar but the associated identifiers are not, so having only the selected displayed text is useless.

It is a very simple cange, create a property of type object called SelectedItem, and in System.Threading.Tasks.Task SelectItem(object item), add this as the first line:

SelectedItem = item;

If you want I can submit a pull request.

---

<div class="post-metadata">

**Author:** ![barry8schneider](https://forum.radzen.com/user_avatar/forum.radzen.com/barry8schneider/32/9777_2.png) [@barry8schneider](https://forum.radzen.com/u/barry8schneider)\
**Post date:** [July 3, 2022, 1:24pm UTC](https://forum.radzen.com/t/autocomplete-get-object-in-data-list/6705/4 "2022-07-03T13:24:15Z")

</div>

@manu did you submit a pull request? i would like to add this functionality.

---

<div class="post-metadata">

**Author:** ![Jason\_Kiesel](https://forum.radzen.com/user_avatar/forum.radzen.com/jason_kiesel/32/14288_2.png) [@Jason\_Kiesel](https://forum.radzen.com/u/Jason_Kiesel)\
**Post date:** [June 1, 2023, 8:35pm UTC](https://forum.radzen.com/t/autocomplete-get-object-in-data-list/6705/5 "2023-06-01T20:35:11Z")

</div>

I would like to +1 this. A string is pretty worthless when using a component like this. Even If I'm navigating to a detail page, I'll need a unique ID of sorts, not the readable string value.

---

<div class="post-metadata">

**Author:** ![Jason\_Kiesel](https://forum.radzen.com/user_avatar/forum.radzen.com/jason_kiesel/32/14288_2.png) [@Jason\_Kiesel](https://forum.radzen.com/u/Jason_Kiesel)\
**Post date:** [June 1, 2023, 8:37pm UTC](https://forum.radzen.com/t/autocomplete-get-object-in-data-list/6705/6 "2023-06-01T20:37:29Z")

</div>

Except I don't want to display all the data when the user clicks the dropdown. I only want to display possible selections when the user begins to type. Is there a way to not show the "list" in a dropdown list until the user begins to type? The dropdown control is not the proper control for this.

---

<div class="post-metadata">

**Author:** ![fabius916](https://forum.radzen.com/letter_avatar_proxy/v4/letter/f/bb73d2/32.png) [@fabius916](https://forum.radzen.com/u/fabius916)\
**Post date:** [June 28, 2023, 2:38pm UTC](https://forum.radzen.com/t/autocomplete-get-object-in-data-list/6705/7 "2023-06-28T14:38:03Z")

</div>

I`m at the same point. Implementing the Autocomplete and I can´t use it, because I need to get back the object or the unique ID which ist different to the TextProperty in which I search.

Example:  
Searching in customer.Name but returning to the bind-value customer.ID

Like this is quite useless because two customers can have the same name.

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [June 28, 2023, 2:44pm UTC](https://forum.radzen.com/t/autocomplete-get-object-in-data-list/6705/8 "2023-06-28T14:44:29Z")

</div>

@fabius916 use the DropDown component

---

<div class="post-metadata">

**Author:** ![Emka\_First](https://forum.radzen.com/user_avatar/forum.radzen.com/emka_first/32/16058_2.png) [@Emka\_First](https://forum.radzen.com/u/Emka_First)\
**Post date:** [October 27, 2023, 8:08am UTC](https://forum.radzen.com/t/autocomplete-get-object-in-data-list/6705/9 "2023-10-27T08:08:48Z")

</div>

Hi team, @korchev @enchev ,  
Guys, I'm just starting with Radzen and love it!  
I got a few bumps, but those were easy to fix. Now, I'm facing one that takes too much time, hence, I'm seeking for your advice, please.

My Autocomplete shows the object name, instead of its string property 🙂

 ![image](https://forum.radzen.com/uploads/default/original/3X/a/b/ab6cdbd05dd81361c2a5015962792ae464aae8f2.png)  
I'm passing a simple struct with 2 public properties: Code and Name (this one is a combination of Code + Some additional info)  
 ![image](https://forum.radzen.com/uploads/default/original/3X/8/4/84960962519eff4da8403cacf2a843513611df94.png)

Interestingly, that it's filtering by the value provided in the input, and the **Change** handler receives the struct with the right values

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [October 27, 2023, 8:11am UTC](https://forum.radzen.com/t/autocomplete-get-object-in-data-list/6705/10 "2023-10-27T08:11:15Z")

</div>

Make sure you have Name property on your objects.

---

<div class="post-metadata">

**Author:** ![Emka\_First](https://forum.radzen.com/user_avatar/forum.radzen.com/emka_first/32/16058_2.png) [@Emka\_First](https://forum.radzen.com/u/Emka_First)\
**Post date:** [October 27, 2023, 8:13am UTC](https://forum.radzen.com/t/autocomplete-get-object-in-data-list/6705/11 "2023-10-27T08:13:31Z")

</div>

Hi @enchev for your prompt response. Yes, it's there:

 ![image](https://forum.radzen.com/uploads/default/original/3X/0/2/02232256fd83be7c5e68a02f06a5bb27a1f78a77.png)

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [October 27, 2023, 8:14am UTC](https://forum.radzen.com/t/autocomplete-get-object-in-data-list/6705/12 "2023-10-27T08:14:16Z")

</div>

This is field, not property.

---

<div class="post-metadata">

**Author:** ![Emka\_First](https://forum.radzen.com/user_avatar/forum.radzen.com/emka_first/32/16058_2.png) [@Emka\_First](https://forum.radzen.com/u/Emka_First)\
**Post date:** [October 27, 2023, 8:16am UTC](https://forum.radzen.com/t/autocomplete-get-object-in-data-list/6705/13 "2023-10-27T08:16:35Z")

</div>

@enchev Legend !!! Really appreciate it!  
Thank you! That must be fatigue, should take a break 🙂

 ![image](https://forum.radzen.com/uploads/default/original/3X/8/b/8b59b42d9e09567804e4b58b14cd9ac8616d8e01.png)

---

<div class="post-metadata">

**Author:** ![rathapon](https://forum.radzen.com/user_avatar/forum.radzen.com/rathapon/32/7343_2.png) [@rathapon](https://forum.radzen.com/u/rathapon)\
**Post date:** [February 26, 2025, 3:24pm UTC](https://forum.radzen.com/t/autocomplete-get-object-in-data-list/6705/14 "2025-02-26T15:24:08Z")

</div>

Dropdown component using for existing data but when i typing not found data it cannot insert data
