开发者

xamDataGrid filter record styling

I'm trying to change the background color of the filter record in a xamDataGrid.

I've tried <SolidColorBrush x:Key="{ComponentResourceKey {x:Type igDP:XamDataGrid}, AddRowBackground}" Color="Red"/> as suggested on the Infragistics forums, and

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

but neither of them worked, my filter row is still white.

开发者_Python百科

Any ideas?


Try

TargetType="{x:Type igDP:DataRecordCellArea}"


The background color comes from a border within the template that uses the AddRowBackground resource. This resource can be set with the following

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

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


I know it's a little late but I've encountered the same issue. What I've found is that I was setting DataRecordCellArea Background which overlaped the AddRowBackground.

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

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

To fix that I've commented out the DataRecordCellArea background

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

And now the filter row background is red

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜