# Styling Rows

> `RadGridView` supports setting the background color of the selected row, as well as setting the mouse-over color of the row. More information can be found in the [SelectedBackground and MouseOverBackground](https://www.telerik.com/products/wpf/documentation/controls/radgridview/rows/selected-row-background) article.

## Targeting the GridViewRow Element

In order to style all RadGridView rows of an application, you should create an appropriate style targeting the `GridViewRow` element.

You have two options:

* To create an empty style and set it up on your own.

* To copy the default style of the control and modify it.

> To modify the default style, see [Editing Control Templates](https://www.telerik.com/products/wpf/documentation/styling-and-appearance/styling-apperance-editing-control-templates).

**Styling all rows of an application**

```XAML
<Style TargetType="telerik:GridViewRow">
    <Setter Property="Background" Value="Red"/>
    <Setter Property="Foreground" Value="White"/>
</Style>
```

> If you're using [Implicit Styles](https://www.telerik.com/products/wpf/documentation/styling-and-appearance/styling-apperance-setting-a-theme-overview), you should base your style on the **GridViewRowStyle**.

## Setting RadGridView's RowStyle and AlternateRowStyle

`RadGridView` exposes the `RowStyle` and `AlternateRowStyle` properties of type `Style`. `GridViewRow` elements can be styled by providing an appropriate style for each of these properties.

> In order to use the `AlternateRowStyle`, you should first set the `AlternationCount` property of your RadGridView. For example, if you want to alternate each second row, you have to set its value to 2.

**Creating styles for the RowStyle and AlternativeRowStyle properties**

```XAML
<Application.Resources>
	 
	<Style x:Key="GridViewRowStyle" TargetType="telerik:GridViewRow">
		<Setter Property="Background" Value="Red"/>
       	<Setter Property="Foreground" Value="White"/>
	</Style>
	 
	<Style x:Key="GridViewAlternateRowStyle" TargetType="telerik:GridViewRow">
		<Setter Property="Background" Value="Blue"/>
           <Setter Property="Foreground" Value="White"/>
	</Style>
</Application.Resources>
```

**Applying styles to the RowStyle and AlternateRowStyle properties**

```XAML
<telerik:RadGridView RowStyle="{StaticResource GridViewRowStyle}"
		     AlternationCount="2"
		     AlternateRowStyle="{StaticResource GridViewAlternateRowStyle}" />
```

> caption RadGridView with styled rows

![Telerik UI for WPF RadGridView with custom RowStyle and AlternateRowStyle applied](https://www.telerik.com/products/wpf/documentation/assets/c9e6e770350298248d903e1bcb1fdbe2/gridview-styled-row-and-alternaterow.png)

## Setting RadGridView's RowStyleSelector and AlternateRowsStyleSelector

You could also use RadGridView's `RowStyleSelector` and `AlternateRowsStyleSelector` properties to style rows differently based on a specific condition. More details about how this can be achieved can be found in the [RowStyleSelector article](https://www.telerik.com/products/wpf/documentation/controls/radgridview/style-selectors/rowstyleselector).

## See Also

* [Alternating Rows](https://www.telerik.com/products/wpf/documentation/controls/radgridview/rows/alternating-rows)

* [Styling the Row Details](https://www.telerik.com/products/wpf/documentation/controls/radgridview/styles-and-templates/styling-row-details)

* [Styling the Group Row](https://www.telerik.com/products/wpf/documentation/controls/radgridview/styles-and-templates/styling-group-row)

* [Styling the Header Row](https://www.telerik.com/products/wpf/documentation/controls/radgridview/styles-and-templates/styling-header-row)
