我将数据填充到我的数据网格中。现在,在最后一列中,我有“失衡”和“失衡”之类的数据。我希望显示器将所有“不平衡”数据显示为带下划线并以红色显示,而“平衡”数据显示为绿色而没有任何下划线。请注意,存储的过程最初会给我所有“输出”平衡”记录,然后是“不平衡”记录。请帮助。我对 WPF 世界完全陌生,必须在星期一之前给出解决方案。提前致谢
Gopakumar
问问题
309 次
1 回答
0
您可以使用 TemplateColumn:
<Controls:DataGrid.Columns>
<Controls:DataGridTemplateColumn>
<Controls:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Data1}" Foreground="Red" TextDecorations="Underline"/>
</DataTemplate>
</Controls:DataGridTemplateColumn.CellTemplate>
</Controls:DataGridTemplateColumn>
</Controls:DataGrid.Columns>
于 2009-10-05T14:45:14.997 回答