This is a migrated thread and some comments may be shown as answers.

Foreground property not working GridViewHeaderCell

2 Answers 60 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Joshua
Top achievements
Rank 1
Joshua asked on 22 Apr 2011, 03:47 PM

Hello I have been trying to style the GridViewHeaderCell in my gridview, but the text will not take the foreground that I assign. How can I achieve this if I don't change the foreground the default foreground for the grid is too dark to read. Please help thank you.

I added the namespace to both the View and Resource :

 

 

xmlns

 

 

:telerikGridView="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView"

 

 

 

 

 


<
telerik:GridViewDataColumn Header="ZipCode" HeaderCellStyle="{StaticResource StandardHeaderCellStyle}" DataMemberBinding="{Binding Something,TargetNullValue=''}" Width="75"/>

<

 

 

Style x:Key="StandardHeaderCellStyle" TargetType="telerik:GridViewHeaderCell">

 

 

 

 

 

 

 

 

 

 

<Setter Property="Foreground" Value="White" />

 

 

 

 

 

 

 

 

 

 

<Setter Property="FontSize" Value="14" />

 

 

 

 

 

 

 

 

 

 

 

 

<Setter Property="FontWeight" Value="Bold" />

 

 

 

 

 

 

 

 

 

 

<Setter Property="FontStyle" Value="Italic" />

 

 

 

 

 

 

 

 

 

 

</Style>

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Vanya Pavlova
Telerik team
answered on 22 Apr 2011, 03:51 PM
Hi Joshua,

 
You may take a look at the following forum thread.


Best wishes,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Joshua
Top achievements
Rank 1
answered on 22 Apr 2011, 04:43 PM
I believe because I have a style setup for my textblock the grid is using that which is why my text kept showing up as dark, Once I plug in the xaml below :

 

 

 

<telerik:GridViewDataColumn Width="110" DataMemberBinding="{Binding FirstName,TargetNullValue=''}">

 

 

 

 

<telerik:GridViewDataColumn.Header>

 

 

 

 

<TextBlock Text="First Name" Style="{StaticResource StandardGridHeaderStyle}"/>

 

 

 

 

</telerik:GridViewDataColumn.Header>

 

 

 

 

</telerik:GridViewDataColumn>

 


I get the results I want applying the StandardGridHeaderStyle. Thanks for your response.
Tags
GridView
Asked by
Joshua
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Joshua
Top achievements
Rank 1
Share this question
or