title: how to apply different Images to DataGridViewImageColumn in Windows form
body: <p>I am using DataGridView ,in which I have dynamically created an Image Column ,I want to diplay Pass and fail Images in this column depeending on the condition below is the code,</p>
  
  <p>DataGridViewImageColumn img = new DataGridViewImageColumn();</p>
  
  <pre><code>                    img.Name = "img";
                      img.HeaderText = "Image Column";
  
  
  
                      dataGridView1.DataSource = dt;
                      dataGridView1.Columns.Add(img);
  
                      int number_of_rows = dataGridView1.RowCount;
  
                      for (int i = 0; i &lt; (number_of_rows - 1); i++)
                      {
                          if (dataGridView1.Rows[i].Cells[2].Value.ToString() == "Pass")
                          {
  
                              Image image = global::Instore.Properties.Resources.pass;
                              img.Image = image;
                              dataGridView1.Rows[i].Cells["img"].Value = image;
  
                          }
                          else if (dataGridView1.Rows[i].Cells[2].Value.ToString() == "Fail")
                          {
                              Image image2 = global::Instore.Properties.Resources.fail;
                              img.Image = image2;
                              dataGridView1.Rows[i].Cells["img"].Value = image2;
  
  
                          }
                      }
  </code></pre>
  
  <p>I have attach the code when I am running it its showing Pass.png in all the rows whereas it should show fail image in some of the rows..</p>
  
  <p>Kindly help...</p>
  
  <p>Thanks
  Sneha</p>