Skip to content

API Proposal: QuickGrid OnRowClick EventCallback #66389

@javiercn

Description

@javiercn

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    api-approvedAPI was approved in API review, it can be implementedapi-proposalarea-blazorIncludes: Blazor, Razor Components

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions