Thanks to visit codestin.com
Credit goes to github.com

Skip to content

MudDataGrid: Expose filter state in FilterTemplate context#13005

Merged
danielchalmers merged 2 commits into
MudBlazor:devfrom
danielchalmers:presidential-marmoset
Apr 17, 2026
Merged

MudDataGrid: Expose filter state in FilterTemplate context#13005
danielchalmers merged 2 commits into
MudBlazor:devfrom
danielchalmers:presidential-marmoset

Conversation

@danielchalmers

@danielchalmers danielchalmers commented Apr 8, 2026

Copy link
Copy Markdown
Member

FilterTemplate now exposes filter state directly through its context. You can use context.FilterIcon to follow the grid’s configured empty/filled filter icons automatically, or context.IsFiltered if you want to switch to your own custom icons.

Example:

<FilterTemplate>
    <MudIconButton OnClick="@OpenFilter" Icon="@context.FilterIcon" Size="@Size.Small" />
    ...
</FilterTemplate>

If you want completely custom icons:

<FilterTemplate>
    <MudIconButton OnClick="@OpenFilter"
                   Icon="@(context.IsFiltered ? MyFilledIcon : MyEmptyIcon)"
                   Size="@Size.Small" />
    ...
</FilterTemplate>

This keeps the feature focused on FilterTemplate instead of adding more DataGrid icon parameters.

Supersedes #12922, #8428, #6238
Relies on #13004
Closes #7478
Closes #10701

Checklist:

  • I've read the contribution guidelines
  • My code follows the style of this project
  • I've added or updated relevant unit tests

@mudbot mudbot Bot changed the title add feature MudDataGrid: Expose filter state in FilterTemplate context Apr 8, 2026
@mudbot mudbot Bot added the enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library label Apr 8, 2026
@danielchalmers danielchalmers merged commit 54d9940 into MudBlazor:dev Apr 17, 2026
10 of 11 checks passed
@danielchalmers danielchalmers deleted the presidential-marmoset branch April 17, 2026 20:16
This was referenced Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow customizing the FilterIcon when using a FilterTemplate in MudDataGrid

1 participant