How to Change the Funnel Filter Icon in RadGridView
Environment
Product | RadGridView for WPF |
Description
How to change the filter icon of the FilteringDropDown control in RadGrdView
Solution
- Extract the ControlTemplate of the
FilteringDropDown
control. - In the template, remove the Grid that holds the two Path elements representing the funnel icon.
- Then add a RadGlyph (or whatever element you prefer) in the Grid's place.
- Use an implicit style (a Style object without x:Key) to apply the customized template to the Template property of FilteringDropDown.
<Window.Resources>
<ControlTemplate TargetType="telerik:FilteringDropDown" x:Key="DistinctFilterControlTemplate">
<Grid>
<Button x:Name="PART_DropDownButton">
<Button.Template>
<ControlTemplate TargetType="Button">
<ContentPresenter/>
</ControlTemplate>
</Button.Template>
<Border Cursor="Hand" MinWidth="22" Background="Transparent">
<!-- the custom icon -->
<telerik:RadGlyph FontSize="16" Glyph="" Foreground="{TemplateBinding Foreground}" />
</Border>
</Button>
<Popup x:Name="PART_DropDownPopup" StaysOpen="True" AllowsTransparency="True" PopupAnimation="Slide"/>
</Grid>
</ControlTemplate>
<Style TargetType="telerik:FilteringDropDown">
<Setter Property="Template" Value="{StaticResource DistinctFilterControlTemplate}"/>
</Style>
</Window.Resources>