This example demonstrates various techniques to display images/icons within data cells. For example, the CustomDrawCell
event is handled to draw icons within CustomDraw column cells.
private void GridView1_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e) {
if (e.RowHandle != GridControl.NewItemRowHandle && e.Column.FieldName == "CustomDraw") {
e.DisplayText = string.Empty;
e.DefaultDraw();
e.Cache.DrawImage(GetImageFromResource(e.CellValue.ToString()), e.Bounds.X, e.Bounds.Y);
}
}
Read the following help topic for more information: Cell Icons - How to Display an Image in a Grid Cell
- Cell Icons - How to Display an Image in a Grid Cell
- How to Display Images from a Data Field with Image Paths
- DevExpress WinForms Cheat Sheet - Display Images in Controls
- DevExpress WinForms Troubleshooting - Grid Control
(you will be redirected to DevExpress.com to submit your response)