3

我正在尝试更改 xamDataGrid 中过滤器记录的背景颜色。

我已经<SolidColorBrush x:Key="{ComponentResourceKey {x:Type igDP:XamDataGrid}, AddRowBackground}" Color="Red"/>按照 Infragistics 论坛上的建议进行了尝试,并且

<Style TargetType="{x:Type igDP:DataRecordPresenter}">
  <Style.Triggers>
    <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsFilterRecord}" Value="True">
      <Setter Property="Background" Value="#363636" />
    </DataTrigger>
  </Style.Triggers>
</Style>

但它们都不起作用,我的过滤器行仍然是白色的。

有任何想法吗?

4

3 回答 3

1

尝试

TargetType="{x:Type igDP:DataRecordCellArea}"
于 2012-02-21T19:30:39.690 回答
0

背景颜色来自使用 AddRowBackground 资源的模板中的边框。可以使用以下设置此资源

<SolidColorBrush x:Key="{ComponentResourceKey {x:Type igDP:XamDataGrid}, AddRowBackground}" Color="#363636"/>

DataPresenterBrushKeys 类: http ://help.infragistics.com/NetAdvantage/WPF/Current/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v11.2~Infragistics.Windows.DataPresenter.DataPresenterBrushKeys.html

于 2012-03-11T19:37:23.237 回答
0

我知道这有点晚了,但我遇到了同样的问题。我发现我正在设置与 AddRowBackground 重叠的 DataRecordCellArea 背景。

<Style TargetType="{x:Type igDp:DataRecordCellArea}">      
  <Setter Property="Background" Value="{DynamicResource DataGridBackgroundBrush}" />
</Style>

<SolidColorBrush x:Key="{ComponentResourceKey {x:Type igDp:XamDataGrid}, AddRowBackground}" Color="Red"/>

为了解决这个问题,我已经注释掉了 DataRecordCellArea 背景

<Style TargetType="{x:Type igDp:DataRecordCellArea}">      
      <!--<Setter Property="Background" Value="{DynamicResource DataGridBackgroundBrush}" />-->
<!-- other stters -->
    </Style>
<SolidColorBrush x:Key="{ComponentResourceKey {x:Type igDp:XamDataGrid}, AddRowBackground}" Color="Red"/>

现在过滤器行背景是红色的

于 2016-04-07T16:27:50.050 回答