Background and Motivation
QuickGrid lacks a built-in way to handle row click events. This is a very common scenario — developers want to navigate to a detail page or perform an action when a grid row is clicked. Issue #44899 has 33+ upvotes requesting this feature. Currently developers must use TemplateColumn with buttons or other workarounds.
PR #64602, fixes #44899. Adds OnRowClick EventCallback to QuickGrid.
Proposed API
namespace Microsoft.AspNetCore.Components.QuickGrid;
public partial class QuickGrid<TGridItem>
{
+ [Parameter] public EventCallback<TGridItem> OnRowClick { get; set; }
}
When OnRowClick is set, row elements receive a row-clickable CSS class and cursor: pointer style.
Usage Examples
<QuickGrid Items="@people" OnRowClick="HandleRowClick">
<PropertyColumn Property="@(p => p.Name)" />
</QuickGrid>
@code {
void HandleRowClick(Person person)
{
NavigationManager.NavigateTo($"/people/{person.Id}");
}
}
Alternative Designs
Using TemplateColumn with an explicit button/link in each row. This requires more markup and doesn't provide the full-row click affordance.
Risks
None — additive parameter. When not set, behavior is unchanged.
Background and Motivation
QuickGrid lacks a built-in way to handle row click events. This is a very common scenario — developers want to navigate to a detail page or perform an action when a grid row is clicked. Issue #44899 has 33+ upvotes requesting this feature. Currently developers must use TemplateColumn with buttons or other workarounds.
PR #64602, fixes #44899. Adds
OnRowClickEventCallbacktoQuickGrid.Proposed API
namespace Microsoft.AspNetCore.Components.QuickGrid; public partial class QuickGrid<TGridItem> { + [Parameter] public EventCallback<TGridItem> OnRowClick { get; set; } }When
OnRowClickis set, row elements receive arow-clickableCSS class andcursor: pointerstyle.Usage Examples
Alternative Designs
Using TemplateColumn with an explicit button/link in each row. This requires more markup and doesn't provide the full-row click affordance.
Risks
None — additive parameter. When not set, behavior is unchanged.