# Styling Column Headers

## Targeting the GridViewHeaderCell element

In order to style all header cells in your application, you should create an appropriate style targeting the **GridViewHeaderCell** 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).

The style in **Example 1** will style all the column headers in your application.

**Example 1: Styling all header cells of an application**

```XAML
<Application.Resources>
	<Style TargetType="telerik:GridViewHeaderCell">
		<Setter Property="Foreground" Value="Red"/>
		<Setter Property="HorizontalContentAlignment" Value="Center"/>
	</Style>
</Application.Resources>
```

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

## Setting a Column's HeaderCellStyle

**RadGridView** header cells can also be styled by creating an appropriate **Style** for the **GridViewHeaderCell** element and setting it as the **HeaderCellStyle** property of the respective **GridView Column**.

The style from **Example 2** will only be applied to the **Number** column as we've set its HeaderCellStyle property.

**Example 2: Setting a column's HeaderCellStyle**

```XAML
<Grid>
    <Grid.Resources>
        <Style x:Key="CustomGridViewHeaderCellStyle" TargetType="telerik:GridViewHeaderCell" BasedOn="{StaticResource GridViewHeaderCellStyle}">
            <Setter Property="Foreground" Value="Red"/>
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
        </Style>
    </Grid.Resources>
    <telerik:RadGridView ItemsSource="{Binding Players}" AutoGenerateColumns="False">
        <telerik:RadGridView.Columns>
            <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" />
            <telerik:GridViewDataColumn DataMemberBinding="{Binding Number}" HeaderCellStyle="{StaticResource CustomGridViewHeaderCellStyle}" />
        </telerik:RadGridView.Columns>
    </telerik:RadGridView>
</Grid>
```

> caption RadGridView with styled header cell

![Telerik UI for WPF RadGridView with a custom HeaderCellStyle applied to a column header](https://www.telerik.com/products/wpf/documentation/assets/dcf98f2d2edcdde90c725696b2ecf900/radgridview_styles_and_templates_styling_gridviewheadercell_03.png)

## See Also

* [Styling a Cell](https://www.telerik.com/products/wpf/documentation/controls/radgridview/styles-and-templates/styling-cell)
* [Styling the Column Footers](https://www.telerik.com/products/wpf/documentation/controls/radgridview/styles-and-templates/styling-column-footers)
