diff --git a/src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/QuickGrid.razor b/src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/QuickGrid.razor index a6c87173ca11..e9368104ec43 100644 --- a/src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/QuickGrid.razor +++ b/src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/QuickGrid.razor @@ -69,30 +69,17 @@ var combinedClass = OnRowClick.HasDelegate ? string.IsNullOrEmpty(rowClass) ? "row-clickable" : $"row-clickable {rowClass}" : rowClass; + var rowClick = OnRowClick.HasDelegate ? EventCallback.Factory.Create(this, () => OnRowClick.InvokeAsync(item)) : default; - if (OnRowClick.HasDelegate) - { - - @foreach (var col in _columns) - { - @{ col.CellContent(__builder, item); } - } - - } - else - { - - @foreach (var col in _columns) - { - @{ col.CellContent(__builder, item); } - } - - } + + @foreach (var col in _columns) + { + @{ col.CellContent(__builder, item); } + } + } private void RenderPlaceholderRow(RenderTreeBuilder __builder, PlaceholderContext placeholderContext)