Home Forums WinForms controls Xceed Grid for WinForms Icon display in WinGrid (for .Net, not WPF) Reply To: Icon display in WinGrid (for .Net, not WPF)

Xceed Support
Member
Post count: 5658

There is already a type in the Grid to display images (or icons).

Here is a snippet that shows how to add icons to all the cells from a column (with an image type).

e.g.,
<code>
Column imageViewer = new Column( “Image”, typeof( System.Drawing.Image ) );
imageViewer.CellViewerManager = new ImageViewer();
gridControl1.Columns.Add( imageViewer );

foreach( Xceed.Grid.DataRow row in gridControl1.DataRows )
{
row.Cells[ “Image” ].Value = new Bitmap( @”C:\Windows.old\Program Files\Microsoft Office\OFFICE11\FORMS\1033\CNFNOT.ICO” );
}
</code>

Imported from legacy forums. Posted by CharlesB (had 3055 views)