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

[Solved] Header-styles for group and filler-column

4 Answers 187 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Rudolf Bösch
Top achievements
Rank 1
Rudolf Bösch asked on 08 Mar 2010, 10:52 AM
Hi there

I'm trying to customize the styles in a RadGridView. Basically, using cutomized HeaderCellStyle and RadGridViewStyle works fine, but how to apply such customisations for the filler-cloumn header and the groups header ?
(see attached screenshot, the custom color is the gray gradient)

Thanks in advance for your help!

Cheers
Rodolphe

4 Answers, 1 is accepted

Sort by
0
Kalin Milanov
Telerik team
answered on 09 Mar 2010, 01:33 PM
Hi Rudolf Bösch,

What you are looking for is the style for the GridViewHeaderRow. You can apply a style to it using HeaderRowStyle property of the RadGridView.

Let me know if you encounter any difficulties in this task.

Regards,
Kalin Milanov
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
Rudolf Bösch
Top achievements
Rank 1
answered on 09 Mar 2010, 02:29 PM
Hi Kalin Milanov,

thanks for your help! However, this does not seem to work. I create a style, kinda like

Style
oStyle = new Style(typeof(GridViewHeaderRow));
oStyle.Setters.Add(
new Setter(GridViewHeaderRow.BackgroundProperty, _headerColor));
oStyle.Setters.Add(new Setter(GridViewHeaderRow
.BorderBrushProperty, _headerColor));

and then assining it to the grid:

RadGrid.HeaderRowStyle =
oStyle;

the result is that the header does not change its style at all (remains all blue gradient).
Anyways, the same procedure with the HeaderCellStyle for each column of the grid works fine, it just does not consider the grouping and the filler columns.

It would be great if you could tell me how the whole header row can be styled the same :o)

cheers
Rudolf
0
Kalin Milanov
Telerik team
answered on 10 Mar 2010, 08:58 AM
Hello Rudolf Bösch,

I would suggest you do all your styling in XAML. Here is how the header row style might look like.

    <UserControl.Resources>
        <Style x:Key="GridViewHeaderRowStyle" TargetType="Telerik_Windows_Controls_GridView:GridViewHeaderRow">
            <Setter Property="Background" Value="Red"/>
            <Setter Property="MinHeight" Value="26"/>
            <Setter Property="BorderBrush" Value="Blue"/>
            <Setter Property="BorderThickness" Value="0,0,0,1"/>
        </Style>
    </UserControl.Resources>
  
    <Grid x:Name="LayoutRoot" Background="White" DataContext="{Binding Source={StaticResource SampleDataSource}}">
        <telerikGridView:RadGridView Margin="0" ItemsSource="{Binding Collection}" HeaderRowStyle="{StaticResource GridViewHeaderRowStyle}" />
    </Grid>

I hope this helps.

Kind regards,
Kalin Milanov
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
Rudolf Bösch
Top achievements
Rank 1
answered on 11 Mar 2010, 08:08 AM
Hi Kalin Milanov,

basically this is no solution inmy project, the styles are applied after getting the users credentials and assigned depending on them. This works for all of the other components I use.

But never mind, I'll find a solution somehow.

Thanks for your help anyways.

Cheers
Rudolf
Tags
GridView
Asked by
Rudolf Bösch
Top achievements
Rank 1
Answers by
Kalin Milanov
Telerik team
Rudolf Bösch
Top achievements
Rank 1
Share this question
or