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

How do I style the row indicator header cell

4 Answers 455 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Joshua
Top achievements
Rank 1
Joshua asked on 14 Apr 2011, 12:23 AM
On the top  left corner there is a blank header cell above the row indicator columns. How do I style this?

Also I've managed to style the column header cells, but when I drag them into the grouped row the style changes back to the original blue. How do I apply styles to those little group labels?

4 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 14 Apr 2011, 07:32 AM
Hi Joshua,

 

Please take a look at the following forum thread. The same is valid for WPF as well. You may also review the Templates Structure of RadGridView in our documentation, following this link. Each part of RadGridView is individually covered and I believe that you may easily achieve the desired result.



If you need any further assistance please let us know.



Greetings,
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 14 Apr 2011, 08:14 AM
Thanks. I can now style the group panel item. 

However, I'm still having trouble styling the header row completely. Its not styling the whole header row as you can see in this pic:
http://i.imgur.com/dlXKD.jpg


My code looks like this:


<Style TargetType="telerik:GridViewHeaderCell">
 
    <Setter Property="Background" Value="Blue"/>
    <Setter Property="Foreground" Value="Red"/>
    <Setter Property="FontWeight" Value="Bold"/>
 
</Style>
0
Vanya Pavlova
Telerik team
answered on 14 Apr 2011, 08:28 AM
Hello Joshua,

 

You have created a style with target type GridViewHeaderCell, in case you need to apply the same style to the header row you have to change the TargetType in the style to a GridViewHeaderRow.
Considering the templates structure of different RadGridView's parts, you cannot change the inner border elements by defining a simple style. In this particular case you have to edit  template of the GridViewHeaderRow to achieve the desired result. The IndicatorPresenter is responsible for displaying the indicator in GridViewHeaderRow. If you need to change this indicator, you have to edit the template of GridViewHeaderRow in the way you need.


You may find attached sample project that demonstrates the approach described above.

Regards,
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 18 Apr 2011, 02:11 AM
Thanks for your help.

I am now trying to get the border brush to match what the header cells have. With the code you have given the border is hard coded in i.e. 
<Border BorderBrush="#FF4B4B4B"

On my app the default theme is Summer. Is there a way to bind the border so it matches the Summer border used in header cells and also allowing for changing themes?

I know by default if I do not explicitly provide a template for the gridviewheaderrow everything is fine when changing themes. However, I need to provide the template so that I can optionally change the background from the viewmodel.
Tags
GridView
Asked by
Joshua
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Joshua
Top achievements
Rank 1
Share this question
or