简体   繁体   English

通过数据集数据源对数据网格进行数据绑定:“图像”列未显示图像,但显示了system.byte []

[英]Databinding datagrid through a dataset datasource: Image column not showing image but system.byte[]

I have dragged and dropped a gridview into designer and configured the datasource to new SQLDataSource where I chose a Image table. 我将gridview拖放到设计器中,并将数据源配置为新的SQLDataSource,在其中选择了Image表。 In that, there are 3 columns (Id, Name, Image as image datatype). 在那,有3列(Id,Name,Image作为图像数据类型)。 However once I configured and run the app, it doesn't show me the image column. 但是,一旦我配置并运行该应用程序,它就不会显示图像列。 Please help me, I want to display the image from the SQL DB to the datagrid 3rd column ... 请帮助我,我想显示从SQL DB到datagrid第三列的图像...

Thank you 谢谢

@Divine: If you post code it will be more helpful. @Divine:如果您发布代码,它将更有帮助。

Few suggestions. 很少的建议。

  1. Do not use auto-generated columns of datagrid, as datagrid doesn't support image template column by default. 不要使用自动生成的datagrid列,因为默认情况下datagrid不支持图像模板列。

  2. You should search to create a DataGrid Template columns. 您应该搜索以创建DataGrid Template列。 That will help you to display image or help you to customize your data and present in certain format. 这将帮助您显示图像或帮助您自定义数据并以某种格式显示。

This article might help you. 本文可能会为您提供帮助。 : http://msdn.microsoft.com/en-us/library/aa479316.aspx http//msdn.microsoft.com/en-us/library/aa479316.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM