I have a DataGridView which was the subject of a previous question (link). But sometimes the Button is null. This is fine. But if it is null, is th
As an improvement to Sriram's answer, I would suggest just overriding the cell painting event and only painting the background. I found that painting a textbox made it look a little odd.
void dataGridView1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
{
if (e.ColumnIndex == yourColumnIndex && String.IsNullOrEmpty((string)e.FormattedValue))
{
e.PaintBackground(e.ClipBounds, true);
e.Handled = true;
}
}