[Solved] DropDownTree in a Razor component always initially blank--doesn't show initial value.

0 Answers 9 Views
DropDownTree
Jonathan
Top achievements
Rank 1
Iron
Jonathan asked on 13 Apr 2026, 12:46 PM

(Telerik.UI.for.Blazor v13.1.0)

I was scratching my head over this one for a while. No matter what I tried, even though the data and initial value were valid, the control always initially showed "None" (or just blank, depending on DefaultText). Interestingly, the X close button also was visible, so the control "knew" the value was set.

I tried all kinds of workarounds, delayed rendering, Rebind(), setting the value programmatically, nothing.

I'm sharing the workaround that worked for me, hopefully save some other users some time. Turned out all I needed to do was to add a custom ValueTemplate:

<TelerikDropDownTree Data="@myTreeData"
                     @bind-Value="selectedTreeValue"
                     DefaultText="None"
                     ShowClearButton="true">
    <ValueTemplate>
        @{
            var selectedItem = FindItemById(myTreeData, selectedTreeValue);
            <span>@(selectedItem != null ? selectedItem.Text : "None")</span>
        }
    </ValueTemplate>
</TelerikDropDownTree>
Dimo
Telerik team
commented on 14 Apr 2026, 06:29 AM

Jonathan, can you please share a runnable test page that exhibits the unexpected behavior? Our online demos and documentation examples seem to work fine.

No answers yet. Maybe you can help?

Tags
DropDownTree
Asked by
Jonathan
Top achievements
Rank 1
Iron
Share this question
or