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

GroupHeader Style

1 Answer 141 Views
GridView
This is a migrated thread and some comments may be shown as answers.
danparker276
Top achievements
Rank 2
danparker276 asked on 01 Sep 2010, 08:33 PM
I want to change the Group Header Style, but not the rows.  Basically I just want to change the font size, so the header sticks out more and maybe the background color.  I can change it with a datatemplate, but how do I bind it?  I couldn't find anyplace to put the style except on the group rows.

                    <telerik:RadGridView.GroupHeaderTemplate  >
                        <DataTemplate>
                            <TextBlock Text="{Binding MyGroup}" FontSize="18" />    
                        </DataTemplate>
                    </telerik:RadGridView.GroupHeaderTemplate>
                   <telerik:RadGridView.GroupDescriptors>
                        <telerik:GroupDescriptor Member="MyGroup">
                        </telerik:GroupDescriptor>
                    </telerik:RadGridView.GroupDescriptors>

1 Answer, 1 is accepted

Sort by
0
Accepted
Vanya Pavlova
Telerik team
answered on 02 Sep 2010, 12:52 PM
Hello Dan,

If you want to just color the group row and make the font size bigger there is no need to provide any data templates. You can create a style for the group row setting the size and the background and you are done. To complete this you will also need to color the indent cell of the row (which only appears when you are grouped) and then set a font size for the regular row. The following XAML will do the trick.

<Style TargetType="telerik:GridViewGroupRow">
            <Setter Property="Background" Value="Red" />
            <Setter Property="FontSize" Value="18" />
        </Style>
        <Style TargetType="telerik:GridViewRow">
            <Setter Property="FontSize" Value="11" />
        </Style>
        <Style TargetType="telerik:GridViewIndentCell">
            <Setter Property="Background" Value="Red" />
        </Style>

Let me know how this goes and does it fit your requirements.

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
Tags
GridView
Asked by
danparker276
Top achievements
Rank 2
Answers by
Vanya Pavlova
Telerik team
Share this question
or