简体   繁体   中英

How to change telerik WPF RadGridView column filtering view template

We are using telerik controls in our project. I want to change telerik Radgrid view's (For WPF) filtering view.

As of now it looks like this as shown below:

Telerik WPF RadGridView列过滤视图

And I want to change the text being show to actual color, so that it looks more realistic for the user to filter. Something like this:

要在过滤视图中显示的颜色代替文本

How to get hold of the template of filtering view and inject the color rectangle there.

How to get hold of the template of filtering view and inject the color rectangle there.

The ControlTemplate can be found in Telerik.Windows.Controls.GridView.xaml:

<ControlTemplate x:Key="FilteringControlTemplate" TargetType="grid:FilteringControl">
...

I customized the ItemTemplate (for the Office2013 theme) to achieve the following, which should give you an indication of what needs to be done. You could also have a look at the CustomFilterControl example.

在此输入图像描述

<ListBox.ItemTemplate>
  <DataTemplate>
    <Grid>
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="20" />
        <ColumnDefinition Width="Auto" />
      </Grid.ColumnDefinitions>
      <CheckBox
        Content=""
        FontSize="13"
        Grid.Column="0"
        IsChecked="{Binding IsActive, Mode=TwoWay}"
        VerticalAlignment="Center"/>
      <Rectangle
        Fill="{Binding ConvertedValue, Converter={StaticResource DistinctValueConverter}}"
        Grid.Column="1"
        Height="16"
        Width="30" />
    </Grid>
  </DataTemplate>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM