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 f11fca3fa5fc..a6c87173ca11 100644
--- a/src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/QuickGrid.razor
+++ b/src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/QuickGrid.razor
@@ -66,9 +66,16 @@
private void RenderRow(RenderTreeBuilder __builder, int rowIndex, TGridItem item)
{
var rowClass = RowClass?.Invoke(item);
+ var combinedClass = OnRowClick.HasDelegate
+ ? string.IsNullOrEmpty(rowClass) ? "row-clickable" : $"row-clickable {rowClass}"
+ : rowClass;
+
if (OnRowClick.HasDelegate)
{
-
OnRowClick.InvokeAsync(item))">
+
OnRowClick.InvokeAsync(item))">
@foreach (var col in _columns)
{
| @{ col.CellContent(__builder, item); } |
@@ -77,7 +84,9 @@
}
else
{
-
+
@foreach (var col in _columns)
{
| @{ col.CellContent(__builder, item); } |
diff --git a/src/Components/test/E2ETest/Tests/QuickGridTest.cs b/src/Components/test/E2ETest/Tests/QuickGridTest.cs
index 8eeef99de766..e2994a1eb41f 100644
--- a/src/Components/test/E2ETest/Tests/QuickGridTest.cs
+++ b/src/Components/test/E2ETest/Tests/QuickGridTest.cs
@@ -136,11 +136,11 @@ public void RowClassApplied()
if (firstName == "Julie")
{
isJulieRowFound = true;
- Assert.Equal("highlight", row.GetDomAttribute("class"));
+ Assert.Equal("row-clickable highlight", row.GetDomAttribute("class"));
}
else
{
- Assert.Null(row.GetDomAttribute("class"));
+ Assert.Equal("row-clickable", row.GetDomAttribute("class"));
}
}