要让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