# GroupRowRender: changing background color

**URL:** <https://forum.radzen.com/t/grouprowrender-changing-background-color/13462>\
**Category:** Blazor Server\
**Created:** [March 15, 2023, 5:41pm UTC](https://forum.radzen.com/t/grouprowrender-changing-background-color/13462 "2023-03-15T17:41:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Scnck](https://forum.radzen.com/user_avatar/forum.radzen.com/scnck/32/11303_2.png) [@Scnck](https://forum.radzen.com/u/Scnck)\
**Post date:** [March 15, 2023, 5:41pm UTC](https://forum.radzen.com/t/grouprowrender-changing-background-color/13462/1 "2023-03-15T17:41:59Z")

</div>

Hello,

What is the trick to change the background on the group headers?

I've tried the following with out luck (using latest version of the NuGet):  
public void OnGroupRowRender(GroupRowRenderEventArgs args) =\> args.Attributes.Add("style", $"background-color: var(--rz-success-lighter);");

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [March 16, 2023, 7:20am UTC](https://forum.radzen.com/t/grouprowrender-changing-background-color/13462/2 "2023-03-16T07:20:58Z")

</div>

> [@Grouping datagrid columns on render with custom header template](https://forum.radzen.com/t/grouping-datagrid-columns-on-render-with-custom-header-template/10556/10):
>
> Almost there! I managed to get the appearance I was looking for: I added a style attribute in the GroupRowRender event to change the background color, and called my custom class to change the text appearance. args.Attributes.Add("style", $"background-color: #479CC8"); args.Attributes.Add("class", $"{(true ? "frameworkDomain" : "frameworkDomain")}"); Modified style class for text Is there a way to incorporate both of these requirements in the class alone?

---

<div class="post-metadata">

**Author:** ![korchev](https://forum.radzen.com/user_avatar/forum.radzen.com/korchev/32/4_2.png) [@korchev](https://forum.radzen.com/u/korchev)\
**Post date:** [March 16, 2023, 9:25am UTC](https://forum.radzen.com/t/grouprowrender-changing-background-color/13462/3 "2023-03-16T09:25:20Z")

</div>

In addition the background color comes from the `td` element and the style you set is applied to its parent `tr` element. Another possible solution is to add this CSS rule

```auto
.rz-group-row td {
   backround-color: inherit !important;
}

```

Then setting the background color of the `tr` should apply to the `td` as well.
