如何将图像绑定到GridView控件。 [英] How to bind images into a GridView control.

查看:95
本文介绍了如何将图像绑定到GridView控件。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用c#在Windows窗体中将图像显示到GridView控件中。

How to display images into a GridView control in windows form using c#.

推荐答案

创建一个列类型为Image的数据表,并将其绑定到网格。 br />


create a datatable having column type as Image, and bind that to grid.

DataTable dt = new DataTable();
dt.Columns.Add("Image", typeof(Image));

dtgrid.DataSource = dt;
dtgrid.DataBind();



希望这会有所帮助。


hope this will help.


Refer - DataGridView中的图像缩略图预览 [ ^ ]。
Refer - Image Thumbnail Preview in DataGridView[^].


这篇关于如何将图像绑定到GridView控件。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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