8
Với hộp, nó hoạt động tốt khi tôi đặt xml sau trong App.xml:Làm thế nào để hiển thị lỗi IDataErrorInfo trong chú giải công cụ trên DataGridTextColumn?
<Style TargetType="{x:Type TextBox}" x:Key="TextBoxValidationStyle">
<Style.Triggers>
<Trigger Property="Validation.HasError" Value="true">
<Setter Property="ToolTip"
Value="{Binding RelativeSource={RelativeSource Self},
Path=(Validation.Errors)[0].ErrorContent}"/>
</Trigger>
</Style.Triggers>
</Style>
Nhưng nó chỉ hoạt động cho textbox, làm thế nào để làm một điều tương tự với DataGridTextColumn?
Vâng, nó hoạt động! Sử dụng DataGridTextColumn.EditingElementStyle thay vì DataGridTextColumn.ElementStyle. Cảm ơn :) – JatSing
p/s: Nếu bạn muốn sử dụng DataGridTextColumn.ElementStyle chỉ cần thay đổi