FilterDropDownList.Blazor
1.1.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package FilterDropDownList.Blazor --version 1.1.1
NuGet\Install-Package FilterDropDownList.Blazor -Version 1.1.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FilterDropDownList.Blazor" Version="1.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FilterDropDownList.Blazor --version 1.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: FilterDropDownList.Blazor, 1.1.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install FilterDropDownList.Blazor as a Cake Addin #addin nuget:?package=FilterDropDownList.Blazor&version=1.1.1 // Install FilterDropDownList.Blazor as a Cake Tool #tool nuget:?package=FilterDropDownList.Blazor&version=1.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
FilterDropDownList.Blazor
A filterable dropdown list component for Blazor applications.
Features
- Filter on multiple properties
- Uses the Virtualize component for rendering performance
- Renders when a paramater of the component is updated or when interacting with the component (for performance)
Limitations
Currently best displays with Bootstrap
Usage/Examples
Install form NuGet
Add Imports in _Imports.razor file
To avoid having to add using statements for FilterDropDownList.Blazor to lots of components in your project, it's recommended that you add the following to your root _Imports.razor file. This will make the following usings available to all component in that project.
@using FilterDropDownList.Blazor.GenericFilterSelect
@using FilterDropDownList.Blazor.GenericFilterSelect.Models;
Basic Usage
<h3>Component</h3>
<FilterSelectComponent @bind-BindValue="SelectedPerson"
TData="PersonModel"
Data="PersonList"
FilterAgainstPropertyName="@($"{nameof(PersonModel.Name)}")"
OnSelectListItem="OnPersonSelected"
Label="Persons">
<RowTemplate>
@context.ID - @context.Name
</RowTemplate>
</FilterSelectComponent>
@code {
public class PersonModel
{
public int ID { get; set; }
public string Name { get; set; }
public string Surname { get; set; }
}
private List<PersonModel> PersonList { get; set; } = new();
public PersonModel SelectedPerson { get; set; } = new();
protected override void OnInitialized()
{
PersonList.Add(new PersonModel { ID = 1, Name = "Huciko", Surname = "Zellikan" });
PersonList.Add(new PersonModel { ID = 2, Name = "John", Surname = "Gray" });
PersonList.Add(new PersonModel { ID = 3, Name = "Jack", Surname = "Black" });
}
// Optional method to execute on item selected
private void OnPersonSelected(FilterSelectComponentEventCallbackArgs<PersonModel> args)
{
// FilterSelectComponentEventCallbackArgs model has two properties
// SelectedItem, a reference to the selected iten in the dropdown
// ExtraParameter, an extra optional parameter (object) to pass together the SelectedItem
string personName = args.SelectedItem.Name;
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net7.0
- Microsoft.AspNetCore.Components.Web (>= 7.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.