2011-08-02 43 views
3

我想要更改xamDataGrid中的过滤器记录的背景颜色。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> 

,但都没有工作,我的过滤器行仍然是白色的。

任何想法?

回答

1

尝试

TargetType="{x:Type igDP:DataRecordCellArea}" 
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"/> 

而且现在的过滤器行背景为红色