Files
radzen-blazor/RadzenBlazorDemos/Pages/DropDownVirtualization.razor
2024-07-26 08:50:50 +03:00

24 lines
898 B
Plaintext

@using RadzenBlazorDemos.Data
@using RadzenBlazorDemos.Models.Northwind
@using Microsoft.EntityFrameworkCore
@inherits DbContextPage
<RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" JustifyContent="JustifyContent.Center" Gap="0.5rem" class="rz-p-sm-12">
<RadzenLabel Text="Select Value" Component="DropDownVirtualization" />
<RadzenDropDown AllowClear="true" @bind-Value=value AllowVirtualization="true" Name="DropDownVirtualization"
AllowFiltering="true" Data=@customers TextProperty="@nameof(Customer.CompanyName)" ValueProperty="@nameof(Customer.CustomerID)" Style="width: 100%; max-width: 400px;" />
</RadzenStack>
@code {
string value;
IEnumerable<Customer> customers;
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
customers = dbContext.Customers.ToList();
}
}