# Dropdown not showing selected item

**URL:** <https://forum.radzen.com/t/dropdown-not-showing-selected-item/12225>\
**Category:** Radzen.Blazor Components\
**Created:** [November 14, 2022, 2:47pm UTC](https://forum.radzen.com/t/dropdown-not-showing-selected-item/12225 "2022-11-14T14:47:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ShawnMack](https://forum.radzen.com/letter_avatar_proxy/v4/letter/s/3be4f8/32.png) [@ShawnMack](https://forum.radzen.com/u/ShawnMack)\
**Post date:** [November 14, 2022, 2:47pm UTC](https://forum.radzen.com/t/dropdown-not-showing-selected-item/12225/1 "2022-11-14T14:47:39Z")

</div>

I'm pretty new to Blazor/Radzen environment and I know I'm not the sharpest clam in the bucket but I still can't figure this out. In all the sample code I could find it didn't seem like the OnChange event needed to do anything to set the SelectedText other than invoking StateHasChanged

I have a List of Properties, the two important fields are string WAddressDisplay and double PropID.  
The Dropdown populates perfectly. I can select the item I want and the OnChange fires perfectly but the selection doesn't show up in the Dropdown selection. I know the item is properly selected because the OnChange returns the correct item.

Here's my HTML for the dropdown

```auto
   <RadzenDropDown AllowClear="true" TValue="string"
              Name="pAddress" AllowFiltering="true"
              @bind-Value=@boundValue
              Data=@PropertyList
              TextProperty="WAddressDisplay" 
              ValueProperty="PropID"
              Change=@(args => OnChange(args, "newAddress")) Class="w-100">
   </RadzenDropDown>

```

Here is my OnChange

```auto
double boundValue = 0;
   ...
    void OnChange(object value, string name)
    {
        var str = value is IEnumerable<object> ? string.Join(", ", (IEnumerable<object>)value) : value;
        if (name == "newAddress")
        {
            if (str != null)
            {
                propertyLink = boundValue;
                buttonOKDisabled = false;
                InvokeAsync(StateHasChanged);
            }
            else
            {
                boundValue = 0;
                propertyLink = "";
                buttonOKDisabled = true;
            }
        }
    }

```

This is my PropertyDTO (abbreviated)

```auto
  public class PropertyLookupDto
    {
        public int Id { get; set; }
        [Required]
        [StringLength(4)]
        public string Town { get; set; } = null!;
        public double PropId { get; set; }
        [StringLength(40)]
        public string WAddressDisplay { get; set; }
    }

```

Selecting an item:

 ![image](https://forum.radzen.com/uploads/default/original/2X/f/fc5246d6d6549def9249e074762ea86dbd8660ff.png)

Results after selecting an item:

 ![image](https://forum.radzen.com/uploads/default/original/2X/2/226678e4954045a0a0d7f4a1c469f6bc40d6cc1b.png)

OK button has been enabled and the PropID has been properly selected, it's just the selected text is still blank ☹

---

<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:** [November 16, 2022, 5:38pm UTC](https://forum.radzen.com/t/dropdown-not-showing-selected-item/12225/2 "2022-11-16T17:38:12Z")

</div>

To set the selection of RadzenDropDownList you should use its Value property. Or `@bind-Value` if you want RadzenDropDown to update the property too. Check the dropdown demos for further reference: [Blazor DropDown Component | Free UI Components by Radzen](https://blazor.radzen.com/dropdown)

---

<div class="post-metadata">

**Author:** ![ShawnMack](https://forum.radzen.com/letter_avatar_proxy/v4/letter/s/3be4f8/32.png) [@ShawnMack](https://forum.radzen.com/u/ShawnMack)\
**Post date:** [November 16, 2022, 6:48pm UTC](https://forum.radzen.com/t/dropdown-not-showing-selected-item/12225/3 "2022-11-16T18:48:50Z")

</div>

I added a @bind-Value as suggested and that did clean up my OnChange logic a little so that's great but the Dropdown Selected Item area is still blank. All the logic in the actual code is working perfectly.

I updated the original post with the new code and sample snapshots of the issue.

Let me know if more details might be helpful.  
Any suggestions would be greatly appreciated.

---

<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:** [November 16, 2022, 6:57pm UTC](https://forum.radzen.com/t/dropdown-not-showing-selected-item/12225/4 "2022-11-16T18:57:28Z")

</div>

What are the values of PropId? Are they unique?
