动态设置DataGridViewImageCell图像 [英] Dynamically Set DataGridViewImageCell Image

查看:625
本文介绍了动态设置DataGridViewImageCell图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

美好的一天!



我的DataGridView中有两列IsTrue和IsTrueImage。 IsTrueImage是一个图像列。



我想根据IsTrue的单元格值是否为真来设置单个图像单元格的图像或者是假的。



我不知道怎么回事。 CellFormatting,RowPrePaint,RowPostPaint。





提前完成...

解决方案

_AKA_KSN_:我知道你喜欢写帖子;我不明白的是你对azinyama的回答。



- 他什么时候提到DataTemplateSelector?



你希望他可能会说它???你有没有读过这个问题?他为什么要谈论它,如果他不写它?



像你这样的人真的加强了神话:随机互联网用户根本不在乎



但是;并回到回答OP。



似乎使用cellformatting事件,可能是要走的路。



这里有几个关于它的话,Azin。



使用-C-和 - 窗口形式-datagridview - 细胞http://johnroach.info/2012/01/13/how-to-add-images-to-datagridview-cell-using-c-and -windows-forms /



http://www.visualwebgui.com/Developers/Community/Projects/ApplicationVEM/Forums/tabid/179/forumid/29/postid /7169/scope/posts/Default.aspx






希望你可能在谈论DataTemplateSelector请点击以下链接。或者让我知道我是不是错了。



http://msdn.microsoft.com/en-us/library/system.windows.controls.datatemplateselector(v = VS.85)的.aspx [ ^ ]

Good day all!!!

I have two columns "IsTrue" and "IsTrueImage" in my DataGridView. "IsTrueImage" is a image column.

I want to set the image for the individual image cells based on the whether or not the cell value for "IsTrue" is true or false.

I'm not sure how to go about this. CellFormatting, RowPrePaint, RowPostPaint.


Thanx in advance...

解决方案

_AKA_KSN_: I understand you like to write posts; what I don't understand is your answer to azinyama.

- When did he mention DataTemplateSelector?

"You hope he might be talking it" ??? Did you even _read_ the question? Why would he be talking about it, if he doesn't write about it?

people like you really strengthen the myth: Random Internet people just dont care.

However; and back to answering OP.

It seems that using the cellformatting event, might be the way to go.

Here's a few threads about it, Azin.

http://johnroach.info/2012/01/13/how-to-add-images-to-datagridview-cell-using-c-and-windows-forms/

http://www.visualwebgui.com/Developers/Community/Projects/ApplicationVEM/Forums/tabid/179/forumid/29/postid/7169/scope/posts/Default.aspx


Hi,

hope you might be talking about DataTemplateSelector please follow the below link. or let me know if am wrong.

http://msdn.microsoft.com/en-us/library/system.windows.controls.datatemplateselector(v=VS.85).aspx[^]


这篇关于动态设置DataGridViewImageCell图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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