WPF DataGrid,根据正值或负值更改单元格文本前景色。 [英] WPF DataGrid, Changing cell Text foreground color based on positive or negative value.

查看:110
本文介绍了WPF DataGrid,根据正值或负值更改单元格文本前景色。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友我在wpf中使用datatable for bind datagrid,其中某些值是负数,所以我需要以红色显示负值。





WPF DataGrid,根据正值或负值更改单元格文本前景色。



所以如何更改wpf网格中特定单元格的颜色。 />


如果有任何可行的方法可以给我建议。



谢谢。

hello friends i use datatable for bind datagrid in wpf in which some value are negative so i need to display negative value in red color.


WPF DataGrid, Changing cell Text foreground color based on positive or negative value.

so how can i change color of particular cell in wpf grid.

if any possible way to do this give me suggestion.

thank you.

推荐答案

您好,我认为您可以在WPF中表示的IValueConverter的帮助下获得必要的结果,根据您在单元格中的值为GridCell提供必要的样式。
Hi, i think you can reach for neccessary results with help of IValueConverter which is represented in WPF, By providing necessary style for GridCell according to your value in cell.


这篇关于WPF DataGrid,根据正值或负值更改单元格文本前景色。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆