xamDataGrid 过滤记录样式
我正在尝试更改 xamDataGrid 中过滤器记录的背景颜色。
我已经按照 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>
但是它们都不起作用,我的过滤器行仍然是白色的。
有什么想法吗?
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.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试
Try
背景颜色来自使用 AddRowBackground 资源的模板内的边框。可以使用以下
DataPresenterBrushKeys 类设置此资源:
http://help.infragistics.com/NetAdvantage/WPF/Current/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v11.2~Infragistics.Windows.DataPresenter.DataPresenterBrushKeys.html
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
我知道有点晚了,但我也遇到了同样的问题。
我发现我正在设置与 AddRowBackground 重叠的 DataRecordCellArea 背景。
为了解决这个问题,我已经注释掉了 DataRecordCellArea 背景
现在过滤器行背景为红色
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.
To fix that I've commented out the DataRecordCellArea background
And now the filter row background is red