将颜色应用于数据表单元格两个值 [英] apply color to datatable cell two values

查看:87
本文介绍了将颜色应用于数据表单元格两个值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有列的数据表.一栏中显示两个值,如2000|300.我想为两个值应用不同的颜色.

您能帮我将颜色应用于字符串变量吗?

在此先感谢您

I have one datatable with columns. In one column two values are displayed like 2000|300. I want to apply different colors for two values.

Can you please help me to apply color to string variable?

Thanks in advance

推荐答案

您可以比通过使用DataGridViewCellPainting进行自定义来做.您检查行和列,并根据需要进行一些自定义绘制.看看这里的例子:
http://ajhorus.wordpress.com/2007/05/03/datagridview-custom -cell-styling/ [ ^ ]

祝你好运!
You can do than by customizing using the DataGridViewCellPainting. You check the row and column and according to that you can do some custom painting if needed. Have a look here for an example:
http://ajhorus.wordpress.com/2007/05/03/datagridview-custom-cell-styling/[^]

Good luck!


请检查以下示例:

http://social.msdn.microsoft.com /forums/en-US/winforms/thread/237dc9c4-def9-4177-851e-a370586c5d29/ [ ^ ]
Please check the following example:

http://social.msdn.microsoft.com/forums/en-US/winforms/thread/237dc9c4-def9-4177-851e-a370586c5d29/[^]


这篇关于将颜色应用于数据表单元格两个值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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