BlazorMultiselectComponent 1.0.0
See the version list below for details.
dotnet add package BlazorMultiselectComponent --version 1.0.0
NuGet\Install-Package BlazorMultiselectComponent -Version 1.0.0
<PackageReference Include="BlazorMultiselectComponent" Version="1.0.0" />
paket add BlazorMultiselectComponent --version 1.0.0
#r "nuget: BlazorMultiselectComponent, 1.0.0"
// Install BlazorMultiselectComponent as a Cake Addin #addin nuget:?package=BlazorMultiselectComponent&version=1.0.0 // Install BlazorMultiselectComponent as a Cake Tool #tool nuget:?package=BlazorMultiselectComponent&version=1.0.0
Blazor Multiselect Component
I built this component because I found the collection binding to InputSelect tedious. This component allows you to bind complex types to a simple multiselect.
PARAMETERS
TOption Type
The type for the collection being passed to the component.
Label string
The text that labels the multiselect input box on the page.
Options ICollection<TOption>?
A collection of all of the possible options for the component to display.
DisplayField string
The string name of the property to use when displaying the options. Preferred way of passing this parameter is by nameof(Model.Property).
SelectedChanged EventCallback<ICollection<TOption>>
The callback which is invoked whenever the underlying value is updated.
Selected ICollection<TOption>
The value that the component holds.
HOW TO USE
Inside of an EditForm, bind your collection Blazor MultiSelectComponent.
Say we have a product with a list of categories:
class ProductCategory { public int Id { get; set; } public string Name { get; set; } } class Product { ... public virtual ICollection<ProductCategory> Categories { get; set; } = new List<ProductCategory>(); }
protected List<ProductCategory> AllCategories { get; set; } = new List<ProductCategory>() { new ProductCategory { Id = 1, Name = "Category 1" }, new ProductCategory { Id = 2, Name = "Category 2" }, new ProductCategory { Id = 3, Name = "Category 3" } };
<EditForm> ... <BlazorMultiSelectComponent.MultiSelect @bind-Selected=@(Product.Categories) Label="Categories" DisplayField=@(nameof(ProductCategory.Name)) Options="AllCategories" /> ... </EditForm>
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- Microsoft.AspNetCore.Components.Web (>= 6.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.