Two-way binding of DropDown selection

The selection of the DropDown doesn't change if SelectedType is changed. Atleast not after initial selection. Are there a right way to express this two-way binding?
So SelectedType is updated when the selection is changed and the selection is changed if SelectedType is changed programatically?

<RadzenDropDown Data="@GetTypes()" @bind-Value="@SelectedType" />

This topic mentions @bind-SelectedItem, is that still valid?

If I try:
<RadzenDropDown Data="@GetTypes()" TValue="string" @bind-SelectedItem="@SelectedType"/>
I get this compilation error:
error CS0266: Cannot implicitly convert type 'object' to 'string'
GetTypes returns List
and
SelectedType is a string

Pretty much all Radzen.Blazor input components support two-way binding via @bind-Value. You can check the DropDown demos for various working configurations.

Well but the demos doesn't demonstrate programatically changing the selected value right?

Hi @Bjorn_Carlsson,

If you believe you have discovered a problem please provide a code snippet which reproduces it. Otherwise my response remains the same - @bind-Value should be used. Make sure you have properly configured the dropdown as well. Right now we don't know what GetTypes() returns and what SelectedType is.

I notice I didn't write the full type information above (it was swallowed by the markup).
GetTypes returns a List<string>
and
SelectedType is a string.
I will try to make a sample that demonstrates the problem. Or come back with my solution.
My question is more or less if I have missed something in my configuration of the DropDown.

This forum supports markdown. Check the FAQ for tips how to format the code.

Here is a working demo with strings.

<RadzenDropDown TValue="string" Data="@data" @bind-Value="@value" />
<RadzenButton Click="@SelectTwo">Select Two</RadzenButton>

@code {
    List<string> data = new List<string>(){ "One", "Two", "Three" };

    string value = "One";

    void SelectTwo()
    {
        value = "Two";
    }
}

dropdown-value

I have now solved my problem.
The problem was that I did set SelectedType in GetTypes()
I thought that should work since it happened when the razor page invoked Gettypes, but now I have changed GetTypes to also call

InvokeAsync(StateHasChanged);

if it needs to update SelectedType