Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Radzen Dropdown didn't show any data

$
0
0

I'm using the Radzen component to show the dropdown, but no data has been shown.

<RadzenFormField Text="Class"><ChildContent><RadzenDropDown Data="@MasterClasses"             TextProperty="Name"             ValueProperty="Id"             @bind-Value="@selectedClass"             Placeholder="Please select a class"/></ChildContent><Helper><RadzenRequiredValidator Component="selectedClass" Text="Class is required" /></Helper></RadzenFormField>@code {    private IEnumerable<MasterClass> MasterClasses;    private int selectedClass;    protected override async Task OnInitializedAsync()    {        MasterClasses = await DbContext.MasterClasses.Select(mc => new MasterClass            {                Id = mc.Id,                ClassroomName = mc.ClassroomName            }).ToListAsync();        await base.OnInitializedAsync();    }}

I already ensured that all the properties had the correct configuration, but I don't know why no data showed up even though there was data in my database. Do you have any idea what might be missing here?

I'm using .NET8 and server side render mode.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>