Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

In MudBlazor's DataGrid, how do I change the labels on default filters?

$
0
0

MudBlazor has a DataGrid component that comes with robust, out-of-the-box filtering capabilities. I am using the mode DataGridFilterMode.Simple, which provides a popover to apply filters to all columns based on the data type of each column.

MudDataGrid simple filter

For numeric columns, these are the filters shown by default. My users are not technical, so I would rather replace !=, >=, and <= with , , and respectively. I can't seem to find a way to do this in the docs. My first thought was using a custom MudLocalizer as described in this answer, but I couldn't get it to work. I'll share my localizer code below in case it's relevant. Am I missing something?

public class CustomMudLocalizer : MudLocalizer{    public static readonly Dictionary<string, string> Overrides = new()    {        ["MudDataGrid.>="] = "≥",        ["MudDataGrid.<="] = "≤",        ["MudDataGrid.!="] = "≠"    };    public override LocalizedString this[string key] =>        Overrides.TryGetValue(key, out var value)            ? new LocalizedString(key, value)            : base[key];}

Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>