本帖最后由 winamw 于 2012-10-07 15:07:30 编辑

解决方案 »

  1.   

    使用模板列,并使用Image控件来显示你的图片地址<ItemTemplate>
           <img src='<%# Eval("imgurl") %>'
    </ItemTemplate> 或是参考下面:
    http://social.microsoft.com/Forums/zh-CN/visualcshartzhchs/thread/bc682f72-33ce-4841-97e3-8a859bcea3bb
      

  2.   


            private void demoGrid_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
            {
                if (demoGrid.Columns[e.ColumnIndex].Name.Equals("Image"))
                {
                    string path = System.Windows.Forms.Application.StartupPath + @"/1.gif";
                    e.Value = GetImage(path);
                }
            } public System.Drawing.Image GetImage(string path)
            {
                System.IO.FileStream fs = new System.IO.FileStream(path, System.IO.FileMode.Open);
                System.Drawing.Image result = System.Drawing.Image.FromStream(fs);
                fs.Close();
                return result;
            }
      

  3.   

    模版列的使用,在模版列中使用<a href='<%# ~/imgpath/Eval("img") #'>img</a>将连接绑定好!