I am getting an invalid cast - I was wondering if this is even possible or is there a better way to do this
private void dgvCurrentUnSerialized_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
for (int i = 0; i < dgvCurrentUnSerialized.Rows.Count; i++)
DataGridViewImageCell cell = dgvCurrentUnSerialized.Rows[i].Cells as DataGridViewImageCell;
var value = "(System.Drawing.Image)Properties.Resources._" + Convert.ToString(dgvCurrentUnSerialized.Rows[i].Cells.Value) + "_sm";
cell.Value = value;
Open in new window
As far as I understood from the code, the cell has the image name and you want to use it to get the image from an embedded resource?