我想更改数据网格行的背景颜色 [英] I want to change the background color of a datagrid row

查看:69
本文介绍了我想更改数据网格行的背景颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在更改其值时更改特定数据网格行的背景颜色。我怎样才能做到这一点。我已将数据表绑定到datagrid项目源。



当我更改数据表值时,它应根据值更改单元格的值。



其中一个colunm命名为weight,其值增加时单元格的背景颜色应为蓝色,如果减小则为红色。

I want to change the background color of a particular of a datagrid row whenever its vaules gets changed. How can i do that. I have binded datatable to datagrid itemsource.

Whenver i am changing datatable values it should change the values of the cells according to value.

One of the colunm is named as "weight" whose value when increases then background color of cell should be blue and if decreases then red.

推荐答案

尝试以下链接 -

http://weblogs.asp.net/psteele/archive/2011/07/28/using-wpf-converters-to-affect-multiple-properties.aspx [<一个href =http://weblogs.asp.net/psteele/archive/2011/07/28/using-wpf-converters-to-affect-multiple-properties.aspx\"target =_ blanktitle =New Window > ^ ]

http://omerkulov.wordpress.com/2010/01/06/how-to-change-cell-text-color-in-wpf-datagri d / [ ^ ]

WPF Datagrid单元格颜色更改 [ ^ ]
Try the following links -
http://weblogs.asp.net/psteele/archive/2011/07/28/using-wpf-converters-to-affect-multiple-properties.aspx[^]
http://omerkulov.wordpress.com/2010/01/06/how-to-change-cell-text-color-in-wpf-datagrid/[^]
WPF Datagrid Cell color change[^]


这篇关于我想更改数据网格行的背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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