Blazor Typed RenderFragment Templates
Supports RenderFragment<CellContext<TItem>> for cell, header and editor templates with full compile-time typing. Templates render as Razor components that are mapped into virtualized cells, so .NET developers can use familiar component syntax.
Planned. This page shows the specification from issue #178. The live example, source for every framework and the API reference replace it when the feature ships.
Live example
A grid with a status badge template, an actions template with buttons and a typed Field expression.
Expected behavior
Templates render and recycle during scroll. Button clicks reach .NET handlers. Field expressions are refactor-safe.
Planned API surface
<WarColumn TItem Field>CellTemplate: RenderFragment<CellContext<TItem>>HeaderTemplateEditTemplate: RenderFragment<EditContext<TItem>>Expression<Func<TItem,object>> FieldAcceptance criteria
- Template context is strongly typed with no object casting (pending)
- Only visible rows' templates are rendered as components (pending)
- Field expressions resolve the property name at compile time (pending)
- Template event handlers run on the correct sync context (pending)