Configuration


Simple Blazor Grid can be configured to your needs, from the way the generated tables look, to how certain data types are displayed in the grid.


Configuration is done at compile-time by passing in an a delegate or instance of SimpleDataGridConfiguration to .AddSimpleBlazorGrid() when configuring your services



Example

The following example configures the primary and secondary color for generated grids as well as sets the default currency symbol to '£'.


builder.Services.AddSimpleBlazorGrid(conf =>
{
    conf.PrimaryColour = "#ff0a54";
    conf.SecondaryColour = "#ff477e";
    conf.CurrencySymbol = "£";
});


SimpleDataGridConfiguration

The table below shows all possible configuration values that can be set. Date and time formatting values will default to the current culture unless overridden.


Property Type Description Default Value
PrimaryColour string Hex primary color of generated tables, will be applied to row separators, buttons etc. #FF0A54
SecondaryColour string Hex secondary color of generated tables, will be applied to selected rows, button hovers etc. #FF0A54
GlyphColour string A Hex colour value that is applied to filter icons in table head #FF0A54
TimeOnlyFormat string How time values should be formatted, example: "HH:mm:ss" CurrentCulture.DateTimeFormat.ShortTimePattern
ShortDateFormat string How short dates should be formatted, example: "dd/MM/yyyy" CurrentCulture.DateTimeFormat.ShortDatePattern
LongDateFormat string How longer dates should be formatted, example: "dd MMMM yyyy" CurrentCulture.DateTimeFormat.LongDatePattern
FullDateTimeFormat string How date and times values should be formatted, example: "dd-MM-yy HH:mm:ss" CurrentCulture.DateTimeFormat.FullDateTimePattern
CurrencySymbol string What the default currency symbol should be when formatting decimals, example: "£" CurrentCulture.NumberFormat.CurrencySymbol
DefaultDecimalPlaces int 4
An error has occurred. This application may no longer respond until reloaded. Reload 🗙