Skip to content

DevExpress-Examples/winforms-grid-display-icons-in-data-cells

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)