in a databound scenario I have a database column value that is of type
varchar with 3 discrete text values.
Binding to this table column with autogenerated columns displays the text
values in a DataGridViewTextBoxColumn column type.
I would like to display images as follows but I need to do so with the
DataGridViewImageColumn column type. How can I do that switcheroo ? Can I
set autogenerate columns to false and somehow transform the text values into
a new column that will accommodate the image display? thank you. -greg
private Bitmap Valid_Image;
Valid_Image = new Bitmap("green_ball.ico");
private void dataGridView1_CellFormatting(object sender,
System.Windows.Forms.DataGridViewCellFormattingEve ntArgs e)
{
if (dataGridView1.Columns[e.ColumnIndex].Name.Equals("Status")) {
String stringValue = e.Value as string;
switch (stringValue)
{
case "NV":
e.Value = NV_NotValidated_Image //cell display does not
display image but rather 'System.Drawing.Bitmap'
break;
case "V":
e.Value = V_Valid_Image;
break;