简体   繁体   English

如何更改telerik WPF RadGridView列过滤视图模板

[英]How to change telerik WPF RadGridView column filtering view template

We are using telerik controls in our project. 我们在项目中使用了telerik控件。 I want to change telerik Radgrid view's (For WPF) filtering view. 我想更改telerik Radgrid视图(For WPF)过滤视图。

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可以在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. 我定制了ItemTemplate(用于Office2013主题)来实现以下功能,它可以指示您需要做什么。 You could also have a look at the CustomFilterControl example. 您还可以查看CustomFilterControl示例。

在此输入图像描述

<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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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