Hello,
When a user adds a row to my DataGridView, my ImageColumn shows a red X instead of the picture I specified. I've already added a CellPainting handler to blank the cell on the NewRow (below). How do I handle the same when the user adds the row?
void grdTests_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
{
if (grdTests.Columns["DeleteTest"].Index.Equals(e.ColumnIndex) && e.RowIndex == grdTests.NewRowIndex)
{
Rectangle rect = new Rectangle(e.CellBounds.X, e.CellBounds.Y, e.CellBounds.Width - 1, e.CellBounds.Height - 1);
Bitmap transparentImage = new Bitmap(20, 20);
e.PaintBackground(rect, true);
e.Graphics.DrawImage(transparentImage, rect);
e.Handled = true;
}
}Would it help if I can somehow invalidate or commit the added row?
Regards