devGridView图片列的处理


//创建图片列数据
DataColumn col = new DataColumn("Picture", typeof(System.Byte[]));
dtRankingStyle.Columns.Add(col);
foreach (DataRow drStyle in dtRankingStyle.Rows)
{
    drStyle["Picture"]=this.GetImage(imagFileFolder + "/" + drStyle["StyleCode"]+".jpg");
}

//绑定数据源
grdRanking.DataSource = dtRankingStyle;
gvRanking.BestFitColumns();

//创建图片列视图,  必须先绑定数据源,再修改ColumnEdit 
RepositoryItemPictureEdit tmpPic = new RepositoryItemPictureEdit();
tmpPic.SizeMode = DevExpress.XtraEditors.Controls.PictureSizeMode.Zoom;
gvRanking.Columns["Picture"].ColumnEdit = tmpPic;
gvRanking.RowHeight = 100;

猜你喜欢

转载自zheyiw.iteye.com/blog/2128085