get image value from DataGridViewImageColumn?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bakulla
    New Member
    • Nov 2009
    • 1

    get image value from DataGridViewImageColumn?

    Hi.

    I have not bounded DataGridView with some DataGridViewIma geColumn-s in my project. Cells in this columns contains different images (see attached picture). I want to somehow get image value of clicked cell and do some action according on which image the cell contains.

    I tried something like this:
    Code:
    private void myGrid_CellContentClick
    (object sender, DataGridViewCellEventArgs e)
    {
         if (myGrid.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.Equals
            (global::nameSpace.Properties.Resources.greenFill))
         { 
             //do something
            MessageBox.Show("Image is green");
         }
    }
    but this do not work :/.

    Im new to C# so sorry for stupid question. Hope, it is understandable.

    Thanks for answers. :)
    Attached Files
Working...