GridColumn 对应值显示对应图片
RepositoryItemImageComboBox repositoryImageComboBox2 = new RepositoryItemImageComboBox();//新建一个RepositoryItemImageComboBox
repositoryImageComboBox2.SmallImages = imageList1; //指定一组图片
string[] s = new String[] {"Beverages", "Condiments", "Confections", "Dairy Products",
"Grains/Cereals", "Meat/Poultry", "Produce", "Seafood"};
for (int i = 0; i < s.Length; i++)
repositoryImageComboBox2.Items.Add(new ImageComboBoxItem(s[i], i + 1, i));//对应值绑定对应的图片
RepositoryItem ri = repositoryImageComboBox2 as RepositoryItem;
gridControl1.RepositoryItems.Add(ri);
colCategoryID.ColumnEdit = ri; //绑定到GridColumn
这样的话,就实现这样的效果
但是想要只让它显示图片,而不显示文字
repositoryImageComboBox2.GlyphAlignment = DevExpress.Utils.HorzAlignment.Center;
这样就可以实现了
有一点要注意,数据类型要一致