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

RadGridView, Changing Colour of Filter icon

1 Answer 105 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 22 Nov 2011, 04:03 AM
I am applying a template and styles to a telerik RadGridView to adjust the colour of the filter icon when it is selected.

My problem is that I apply a style like this,

    <telerik:GridViewDataColumn HeaderCellStyle="{StaticResource GridViewHeaderCellStyle}" ></telerik:GridViewDataColumn>

The style is generated by expression blend when I selected the option to generate template.

The problem is that I want to apply a theme like this,

    Telerik.Windows.Controls.StyleManager.ApplicationTheme = new Telerik.Windows.Controls.Windows7Theme();

But then all of a sudden the style that expression blend generated doesn't match the theme. Is there a way to get the style as defined by the theme?

If I then remove parts of the style to only define the dropdown style like this (which means the rest of the header won't be changed and the theme will match the resulting style),

    <Style TargetType="GridView:FilteringDropDown">
        <Setter Property="Template" Value="{StaticResource DistinctFilterControlTemplate}"/>
    </Style>

It works if the theme is off, it applies the template only to the filtering drop down, but if the theme is on then the style gets ignored.

1 Answer, 1 is accepted

Sort by
0
Peter
Top achievements
Rank 1
answered on 23 Nov 2011, 05:17 AM
Figured it out.

A bit of a hack really, but I had to go into the dll, Telerik.Windows.Themes.Windows7.dll using ILSpy and look up the xaml file called,

gridviewheadercell.xaml

If I then copied that over, and applied the style. I then had to go back to expression blend, and edit the template for PART_DistinctFilterControl and go from there.

It works, but if we at some stage decide to apply a different theme, or telerik change the current theme then it could cause issues.

I am open to better suggestions.

Tags
GridView
Asked by
Peter
Top achievements
Rank 1
Answers by
Peter
Top achievements
Rank 1
Share this question
or