GKit.UI.MudBlazorExt
1.1.2
See the version list below for details.
dotnet add package GKit.UI.MudBlazorExt --version 1.1.2
NuGet\Install-Package GKit.UI.MudBlazorExt -Version 1.1.2
<PackageReference Include="GKit.UI.MudBlazorExt" Version="1.1.2" />
<PackageVersion Include="GKit.UI.MudBlazorExt" Version="1.1.2" />
<PackageReference Include="GKit.UI.MudBlazorExt" />
paket add GKit.UI.MudBlazorExt --version 1.1.2
#r "nuget: GKit.UI.MudBlazorExt, 1.1.2"
#:package GKit.UI.MudBlazorExt@1.1.2
#addin nuget:?package=GKit.UI.MudBlazorExt&version=1.1.2
#tool nuget:?package=GKit.UI.MudBlazorExt&version=1.1.2
GKit.UI.MudBlazorExt
MudBlazor adapter for the GKit UI components. Succeeds GKit.MudBlazorExt.
The components here are presentation only; paging, the DbContext lifecycle, CRUD orchestration,
ordering and export live in GKit.UI.Data and reference no component library. GKit.UI.RadzenExt is
the sibling adapter over the same engine.
An application picks one adapter. Both expose the same component names, type parameters and
parameter names, so moving a page between them is a package swap, an @using change, and a
rewrite of the column markup and form bodies — see GKit.UI.RadzenExt's README for the differences
that survive the abstraction.
Setup
builder.Services.AddMudServices(); // MudBlazor's own setup
builder.Services.AddMudTranslations(); // optional, MudBlazor's internal strings
builder.Services.AddGKitBlazorServices(); // GKit.BlazorExt
builder.Services.AddGKitMudBlazorUi(); // this package (calls AddGKitUiCore internally)
builder.Services.AddGKitUiLocalization(); // optional, for Italian
@* _Imports.razor *@
@using MudBlazor
@using GKit.BlazorExt
@using GKit.UI
@using GKit.UI.Data
@using GKit.UI.MudBlazorExt
Components
| Component | Purpose |
|---|---|
ManagedGrid<T> |
Virtualised server-side MudDataGrid with toolbar, row controls and XLSX export |
EntityGrid<T, TDialog> |
ManagedGrid plus create / edit / delete against an EF entity |
EditEntityDialog<T, TForm, TValidator> |
Dialog shell hosting a form, validated by FluentValidation |
EntityAutocomplete<T> / EntityItemAutocomplete<T, TItem> |
Lookup over a DbContext, with inline create |
ManagedAutocomplete<T> / ManagedItemAutocomplete<T, TItem> |
Lookup over an arbitrary fetch delegate |
DataAutocomplete<T> |
Lookup over a pre-built query |
ManagedText |
Text with copy-to-clipboard and optional masking |
Revealing clipped cell values
A column narrow enough to be readable is narrow enough to clip its own content. GKitCellReveal
clips the value to one line and, on hover, opens a panel over the cell showing the whole of it. The
panel's text is selectable — that is how a user copies it, so there is no copy button.
There are two ways in, and which you want depends on whether you are also supplying your own cell content.
1. The column — automatic
GKitPropertyColumn<T, TProperty> derives from MudBlazor's PropertyColumn<T, TProperty> and
supplies the reveal for you. Adopting it is a one-token edit:
- <PropertyColumn T="Order" TProperty="string" Property="x => x.Notes" Title="Notes" />
+ <GKitPropertyColumn T="Order" TProperty="string" Property="x => x.Notes" Title="Notes" />
Every inherited parameter keeps working — sorting, filtering, Format, width, visibility — because
they are inherited rather than reimplemented.
| Parameter | Default | Purpose |
|---|---|---|
Ellipsis |
true |
Set false for a column whose values are short enough that clipping only adds noise |
PopoverClass |
— | CSS classes for the revealed panel's popover |
ListClass |
— | CSS classes for the list around the panel |
2. The component — anywhere you author cell content
GKitCellReveal is public, so you can place it yourself — in a TemplateColumn, or anywhere else:
<TemplateColumn T="Order" Title="Notes">
<CellTemplate>
<GKitCellReveal Value="@context.Item.Notes" />
</CellTemplate>
</TemplateColumn>
How the two relate
Supplying your own CellTemplate on a GKitPropertyColumn opts out of the automatic reveal —
the library renders your content and never wraps or discards it. If you want custom content and
the reveal, place the component inside your own template:
<GKitPropertyColumn T="Order" TProperty="string" Property="x => x.Notes" Title="Notes">
<CellTemplate>
<MudIcon Icon="@Icons.Material.Filled.Notes" Size="Size.Small" />
<GKitCellReveal Value="@context.Item.Notes" />
</CellTemplate>
</GKitPropertyColumn>
Worth knowing
- The reveal opens whether or not the value actually overflows. Suppressing it for text that happens to fit needs DOM measurement the component model cannot do without JavaScript, and the cost outweighs the benefit.
- No setup is required. The appearance ships as scoped CSS, which a Razor Class Library bundles
into your application's styles — no
<link>, no asset copy. - It is a menu, not a tooltip. A tooltip hides when the pointer leaves the cell and sits outside
the cell's subtree, so the pointer can never reach the revealed text to select it. That is the
reason this is built on
MudMenu. - There is no grid-level switch.
ManagedGridreceives your columns as an opaqueRenderFragment, andMudDataGridexposes only row-level hooks, so the per-column edit above is the whole available surface.
Migrating from GKit.MudBlazorExt
The namespace changed and the grid state types are now neutral, so that the same application code compiles against either adapter.
| Before | After |
|---|---|
namespace GKit.MudBlazorExt |
namespace GKit.UI (contracts) / GKit.UI.MudBlazorExt (components) |
ManagedGridRowControlDescriptor<T> |
GridRowControl<T> |
ManagedGridRowControlsVariant |
GridRowControlsVariant |
CellContext<T> in row controls |
RowContext<T> |
Color.Error |
UiColor.Error |
Icons.Material.Filled.Edit |
UiIcon.Edit, or IconOverride = Icons.Material.Filled.Edit |
GridStateVirtualize<T> / GridData<T> in LoadServerData |
GridQuery<T> / GridPage<T> |
QueryFilterExtensions.Where(q, state.FilterDefinitions) |
state.ApplyFilters(q) |
grid.FilterDefinitions |
grid.Filters (a GridFilterSet<T>) |
IEnumerable<IFilterDefinition<T>> parameters |
GridFilterSet<T> |
AbstractValidatorBase<T>, IEditEntityForm<T>, IEditEntityDialog<T> |
unchanged, now in GKit.UI |
Validator classes, EditEntityDialog subclasses, form @code blocks and query factories need no
changes beyond the @using.
Loading data
- private async Task<GridData<Item>> LoadServerData(GridStateVirtualize<Item> state, CancellationToken token)
+ private async Task<GridPage<Item>> LoadServerData(GridQuery<Item> state, CancellationToken token)
{
using var ctx = await factory.CreateDbContextAsync();
var query = ctx.Set<Item>().AsQueryable();
- query = QueryFilterExtensions.Where(query, state.FilterDefinitions);
- query = QuerySortExtensions.OrderBy(query, state.SortDefinitions);
+ query = state.Apply(query);
- return new GridData<Item> { TotalItems = await query.CountAsync(token), Items = … };
+ return new GridPage<Item> { TotalItems = await query.CountAsync(token), Items = … };
}
Row controls
- new ManagedGridRowControlDescriptor<Item> {
+ new GridRowControl<Item> {
Text = "Download",
- Icon = Icons.Material.Filled.Download,
- Color = Color.Primary,
+ Icon = UiIcon.Download,
+ Color = UiColor.Primary,
- Action = ctx => DoAsync(ctx.Item)
+ Action = ctx => DoAsync(ctx.Item) // ctx is now RowContext<Item>
}
Behaviour notes
- Validation is unchanged. MudForm still drives validation, so the touched-gated save button
and
ValidationDelaybehave exactly as before. Only the Radzen adapter usesEditContext. - Filtering and sorting are unchanged.
GridQuery<T>carries MudBlazor's own filter and sort application across as delegates rather than reinterpreting them, so a filtered grid produces the same SQL as before. - Strings default to English. Reference
GKit.UI.Localizationand run underit-ITfor the previous Italian wording. - Delete confirmations are HTML-encoded. The entity description interpolated into the confirmation prompt used to be raw, which made any user-controlled field a stored-XSS sink.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- GKit.BlazorExt (>= 1.1.2)
- GKit.UI.Abstractions (>= 1.1.2)
- GKit.UI.Data (>= 1.1.2)
- Microsoft.AspNetCore.Components.Web (>= 10.0.14)
- Microsoft.EntityFrameworkCore (>= 10.0.14)
- MudBlazor (>= 9.12.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.