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 Background を設定していたことです。

<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 に答える