private void OnDataGridViewCellFormat(object sender, DataGridViewCellFormattingEventArgs e) { if (this.dataGridView.Columns[e.ColumnIndex].Name == "imgType") { Assembly a = Assembly.GetExecutingAssembly(); // get a list of resource names from the manifest //string[] resNames = a.GetManifestResourceNames(); int iRow = e.RowIndex; if (cdsMessageDataSet.Messages[iRow].msgtype == "E") { e.Value = Bitmap.FromStream(a.GetManifestResourceStream("cdsProCS.Resources.Work.bmp")) as Bitmap; } else { e.Value = Bitmap.FromStream(a.GetManifestResourceStream("cdsProCS.Resources.PhoneCall.bmp")) as Bitmap; } } }I have also tried:
DataRowView dv = cdsMessageDataSet.Messages.DefaultView[iRow]; if (dv["msgtype"].ToString() == "E")To no avail.