Skip to content

Latest commit

 

History

History
44 lines (30 loc) · 2.79 KB

File metadata and controls

44 lines (30 loc) · 2.79 KB

WinForms Data Grid - Display icons in grid cells

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

Files to Review

See Also

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)