# .NET and More > Silverlight >  Using Setter to set background of datagrid header

## peteshir

I am using SL 4. I have created a datagrid but I cannot set the Background Color in either the body of the grid or the header.

Here is a snippet of my code;
                <sdk :Big Grin: ataGrid.ColumnHeaderStyle>
                    <Style TargetType="sdk :Big Grin: ataGridColumnHeader">
                        <Setter Property="FontFamily"  Value="Georgia"></Setter>
                        <Setter Property="Foreground" Value="Maroon"></Setter> 
                        <Setter Property="FontWeight" Value="Bold"></Setter>
                        <Setter Property="Background" Value="Maroon"></Setter>
                    </Style>
                </sdk :Big Grin: ataGrid.ColumnHeaderStyle>

It all works except the background.

Does anyone have any ideas
Pete

----------


## MattP

There is no Background property to you'll have to customize its template.

Namespace:



```
xmlns:primitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls.Data"
```



```
<Style x:Name="ColumnHeader" TargetType="primitives:DataGridColumnHeader">
	<Setter Property="FontFamily" Value="Georgia" />
	<Setter Property="FontWeight" Value="Bold" />
	<Setter Property="Foreground" Value="Maroon" />
	<Setter Property="Template">
		<Setter.Value>
			<ControlTemplate TargetType="primitives:DataGridColumnHeader">
				<StackPanel Orientation="Vertical">
					<Border Name="HeaderSeparator" VerticalAlignment="Stretch" Background="Maroon">
						<TextBlock Text="{TemplateBindingContent}" />
					</Border>
				</StackPanel>
			</ControlTemplate>
		</Setter.Value>
	</Setter>
</Style>
```

You may want to check out this link for a fancier example that was changed using Blend.

http://stackoverflow.com/questions/3...in-silverlight

----------

