WPF Datagrid Cell with Validation Error Style
问题 I am trying to change the default style of a DataGridCell (within a WPF Toolkit DataGrid) when there is a validation error. The default is a red border. How can I put my own template? Thanks. 回答1: Try this: <!-- Cell Style --> <Style x:Key="CellErrorStyle" TargetType="{x:Type TextBlock}"> <Style.Triggers> <Trigger Property="Validation.HasError" Value="true"> <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}"/> <Setter