2
我想基于dataTrigger更改AlternatingRowBackground颜色。 我收到来自IDE的错误,它不会生成(请参阅下面的xaml)。在触发器上设置Wpf AlternatingRowBackground
错误:找不到样式属性的类型“AlternatingRowBackground 'System.Windows.Controls.DataGridRow'
的XAML
<Style TargetType="{x:Type DataGridRow}">
<Setter Property="AlternatingRowBackground" Value="Beige" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{StaticResource SelectedRowBackgroundBrush}" />
</Trigger>
<DataTrigger Binding="{Binding BondType}" Value="P">
<Setter Property="Background" Value="Pink"/>
<Setter Property="AlternatingRowBackground" Value="LightPink" />
</DataTrigger>
</Style.Triggers>
</Style>
任何想法,将不胜感激。
谢谢我会试一试,回到你身边,有道理。 – DermFrench
嗨,我实际上想要做的是在交替行上应用biege,除非在datatrigger被满足时,在那个阶段我需要lightpink。那可能吗? – DermFrench
你是说你想要改变交替行的rowRowColor的行在哪里dataTrigger符合? – theartwebreathe