[代码]--给GridControl中的某列添加图片

要让GridControl的某列显示图片只须要数据源中有图片就能够正确显示spa

一、给DataSet添加一列,格式为imagecode

 ds.Tables[0].Columns.Add("SIGN", typeof(Image));

二、遍历ds给指定的列赋值orm

foreach (DataRow row in dsTable.Tables[0].Rows)
{
    drArr = table.Select(string.Format("TABLENAME = '{0}'", row["TABNAME"]));
     if (drArr.Length > 0 || drArr == null)
    {
         row["SIGN"] = Resources.sign;
     }
    else
    {
        row["SIGN"] = Resources.white;
     }
    drArr = null;
}
dsTable.Tables[0].AcceptChanges();    

三、数据源赋给GridControlblog

相关文章
相关标签/搜索