A
Schau dir mal das "CellPainting" Event vom DataGridView an.
Das wird aufgerufen, wenn eine Zelle gezeichnet wird.
Da kann man dann reinzeichnen was man will, u. a. auch Bilder.
Siehe auch: http://msdn2.microsoft.com/en-us/library/system.windows.forms.datagridview.cellpainting(VS.80).aspx
Ist zwar C# Code, aber sollte kein Problem sein, da C++/CLI draus zu machen.
private void dataGridView1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
{
// Paint the bitmap only in the first cell of first row
if (e.ColumnIndex != 0 || e.RowIndex != 0)
{return;}
Brush gridBrush = new SolidBrush(this.dataGridView1.GridColor);
Brush backColorBrush = new SolidBrush(e.CellStyle.BackColor);
Pen gridLinePen = new Pen(gridBrush);
// Erase the cell.
e.Graphics.FillRectangle(backColorBrush, e.CellBounds);
// Draw the grid lines (only the right and bottom lines;
// DataGridView takes care of the others).
e.Graphics.DrawLine(gridLinePen, e.CellBounds.Left, e.CellBounds.Bottom - 1, e.CellBounds.Right - 1, e.CellBounds.Bottom - 1);
e.Graphics.DrawLine(gridLinePen, e.CellBounds.Right - 1, e.CellBounds.Top, e.CellBounds.Right - 1, e.CellBounds.Bottom);
// Draw the bitmap
e.Graphics.DrawImage(m_bitmap, new Point(e.CellBounds.Left + 5, e.CellBounds.Top + 5));
// Draw the text content of the cell, ignoring alignment.
if (e.Value != null)
{
e.Graphics.DrawString
(
(String)e.Value,
e.CellStyle.Font,
Brushes.Crimson,
e.CellBounds.X + m_bitmap.Width + 5, // draw text aside the bitmap
e.CellBounds.Y + 2,
StringFormat.GenericDefault
);
}
e.Handled = true;
}