FilterDropDownList.Blazor 1.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package FilterDropDownList.Blazor --version 1.1.0                
NuGet\Install-Package FilterDropDownList.Blazor -Version 1.1.0                
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.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FilterDropDownList.Blazor --version 1.1.0                
#r "nuget: FilterDropDownList.Blazor, 1.1.0"                
#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.0

// Install FilterDropDownList.Blazor as a Cake Tool
#tool nuget:?package=FilterDropDownList.Blazor&version=1.1.0                

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)
  • Supports Bootstrap's dark theme

Limitations

Currently best displays with Bootstrap 5.3

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 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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.0 500 3/13/2023
1.1.1 251 3/11/2023
1.1.0 210 3/11/2023
1.0.0 236 3/10/2023