在网格中应用颜色 [英] Applying color in grid

查看:75
本文介绍了在网格中应用颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为网格的每一行应用颜色,我将颜色值存储在SQL数据库中,当我从数据库中检索颜色值并将其应用于网格的当前行时,不应用原始颜色.
窗口颜色仅适用于网格当前行,我的颜色值为"oxffffff80",但只有窗口A = 255,R = 255,G = 255,b = 255,该颜色仅适用于当前行,我该怎么做应用我存储在数据库中的确切颜色?

[edit]仅整理[/edit]

I am applying color for each row of my grid, I stored color value''s in my SQL database, and when I retrieve the color value''s from database and apply to current row of grid, it''s not applying the original color.
The Window color only applying to my grid current row, my color value is "oxffffff80" but only the window A=255,R=255,G=255,b=255 this color only applying to current row, what shall I do to apply exact color that I stored in my database?

[edit]Tidy up only[/edit]

推荐答案

您可能将不得不处理Paint事件并自己绘制所有内容以实现此目的.您也可以选择创建一个继承自GridView的新对象,然后在此处进行操作.实际上,我可能会走那条路.

有关执行上述两项操作的说明,请使用google.实际上,我什至会半心半意地尝试查找已经编写的自定义控件.同样,google是您的朋友(您甚至可以在CodeProject上找到有关它的文章.
You''re probably going to have to handle the Paint event and draw everything yourself to pull this off. You could alternatively just create a new object that inherits from the GridView, and do it there. In fact, I''d probably go that route.

For instructions on doing either of those two things, use google. In fact, I would even make a halfhearted attempt to find a custom control that''s already been written. Again, google is your friend (and you might even find an article about it here on CodeProject.


这篇关于在网格中应用颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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