1
設置後臺對DataGridCheckBoxColumn
正常工作,但對於DataGridTextColumn
不適用。我將它設置爲資源中的單元格:如何在WPF中IsEditing = True時更改DataGridCell的背景
<Style TargetType="{x:Type DataGridCell}">
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#ffff00" />
</Trigger>
<Trigger Property="IsEditing" Value="True">
<Setter Property="BorderThickness" Value="1" />
<Setter Property="BorderBrush" Value="#00ff00" />
<Setter Property="Background" Value="#00ff00" />
</Trigger>
</Style.Triggers>
</Style>
有沒有針對此問題的解決方案?在<Window.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.WindowBrushKey}" Color="Transparent" />
在你的資源
,例如:
這觸發不工作? – franssu
'IsEditing'不能在'DataGridTextColumn'中使用,因爲它在編輯模式下有自己的背景風格,我想 –