# Using a default value in a dropdown

**URL:** <https://forum.radzen.com/t/using-a-default-value-in-a-dropdown/10420>\
**Category:** Blazor Server\
**Created:** [March 24, 2022, 2:11pm UTC](https://forum.radzen.com/t/using-a-default-value-in-a-dropdown/10420 "2022-03-24T14:11:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jose\_R\_Camilo](https://forum.radzen.com/user_avatar/forum.radzen.com/jose_r_camilo/32/8638_2.png) [@Jose\_R\_Camilo](https://forum.radzen.com/u/Jose_R_Camilo)\
**Post date:** [March 24, 2022, 2:11pm UTC](https://forum.radzen.com/t/using-a-default-value-in-a-dropdown/10420/1 "2022-03-24T14:11:21Z")

</div>

I got to set a default value for this dropdown to show selected when the page loads. However, the issue I am having, is that after the value is changed by the user, if the user wants to reset the dropdown, it would not change to the initial value.

```auto
@inject EventServiceHub _eventService
@inject IJSRuntime _jsRuntime
@implements IDisposable 

<div class="d-flex flex-column border-end border-1 px-2 py-1" style="width:200px">

    <label class="text-secondary">Affirmation Status</label> 

    <RadzenDropDown @ref="affirmStatusDDL" TValue="string" Data="@AffirmStatusList" 
                                     Value="@_selectedItem" SelectedItem="@_selectedItem"
                                     Change="@(value => OnValueChanged(value.ToString()))"/>

</div> 

@code {

    protected RadzenDropDown<string> affirmStatusDDL;
    protected List<string> AffirmStatusList;
    private string _selectedItem = "Open"; 

    protected override void OnInitialized()
    {
        AffirmStatusList = new List<string>() { "All", "Expired", "Open", "Required", "Not Required" };
        _eventService.OnFilterReset += ResetFilter;
    } 

    protected void OnValueChanged(string value)
    {
        FilterParameters.AffirmStatuses = value;
        StateHasChanged();
    }

    private void ResetFilter(object s, string args)
    {
        _selectedItem = "Open";
        if (affirmStatusDDL != null)
        {
            affirmStatusDDL.SelectedItem = _selectedItem;
            affirmStatusDDL.Value = _selectedItem;
        }
        FilterParameters.AffirmStatuses = "Open";
        StateHasChanged();
    } 

    public void Dispose()
    {
        _eventService.OnFilterReset -= ResetFilter;
    }

}

```

I tried a few different ways to set the value back to the initial one on Reset but no luck yet. This is my latest attempt.

---

<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:** [March 24, 2022, 3:50pm UTC](https://forum.radzen.com/t/using-a-default-value-in-a-dropdown/10420/2 "2022-03-24T15:50:41Z")

</div>

You can use @bind-Value and set the variable to null when needed.

---

<div class="post-metadata">

**Author:** ![Jose\_R\_Camilo](https://forum.radzen.com/user_avatar/forum.radzen.com/jose_r_camilo/32/8638_2.png) [@Jose\_R\_Camilo](https://forum.radzen.com/u/Jose_R_Camilo)\
**Post date:** [March 24, 2022, 4:19pm UTC](https://forum.radzen.com/t/using-a-default-value-in-a-dropdown/10420/3 "2022-03-24T16:19:41Z")

</div>

Thank you @enchev. It worked by replacing Value with @bind-Value

---

<div class="post-metadata">

**Author:** ![Jose\_R\_Camilo](https://forum.radzen.com/user_avatar/forum.radzen.com/jose_r_camilo/32/8638_2.png) [@Jose\_R\_Camilo](https://forum.radzen.com/u/Jose_R_Camilo)\
**Post date:** [March 24, 2022, 6:44pm UTC](https://forum.radzen.com/t/using-a-default-value-in-a-dropdown/10420/4 "2022-03-24T18:44:06Z")

</div>

Actually, SelectedItem is not really needed either.
