title: cannot change image in datagridview winforms
body: <p>i need to change the image of the column if a path specified in another column exists.</p>
  
  <p>i have the following code:</p>
  
  <pre><code>dataGridView1.DataSource = table;
  
  
          DataGridViewButtonColumn buttonCol = new DataGridViewButtonColumn();
          buttonCol.HeaderText = "";
          buttonCol.Name = "BrowseButton";
          buttonCol.Text = "...";
          buttonCol.UseColumnTextForButtonValue = true; 
          dataGridView1.Columns.Add(buttonCol);
  
          DataGridViewImageColumn imgCol = new DataGridViewImageColumn();
          imgCol.HeaderText = "Status";
          imgCol.Name = "StatusImage";
          imgCol.Image = null;
          dataGridView1.Columns.Add(imgCol);
          dataGridView1.Columns["StatusImage"].DisplayIndex = 4;
  
   foreach (DataGridViewRow myRow in dataGridView1.Rows)
          {
              string overRiddenDirPath = myRow.Cells["Overridden Dir"].Value.ToString();
              string preConfiguredPath = myRow.Cells["PreConfigured Dir"].Value.ToString();
              string path = overRiddenDirPath;
              if (overRiddenDirPath == "")
              {
                  path = preConfiguredPath;
              }
  
              DataGridViewImageCell cell = myRow.Cells["StatusImage"] as DataGridViewImageCell;
  
              // If the directory doesn't exist
              if (!Directory.Exists(path))
              {
                  cell.Value = Image.FromFile(@"Chrysanthemum.jpg");
              }
              else
              {
                  cell.Value = Image.FromFile(@"Jellyfish.jpg");                   
              }
          }
  </code></pre>
  
  <p>no image is getting displayed: 
  the path of the image is fine because if i put it like this :</p>
  
  <pre><code>  DataGridViewImageColumn imgCol = new DataGridViewImageColumn();
          imgCol.HeaderText = "Status";
          imgCol.Name = "StatusImage";
          imgCol.Image = Image.FromFile(@"Chrysanthemum.jpg");
          dataGridView1.Columns.Add(imgCol);
          dataGridView1.Columns["StatusImage"].DisplayIndex = 4;
  </code></pre>
  
  <p>it gets displayed but it does not change on the condition.</p>
  
  <p>Also, is there a better way to add images to a datagridview cells.</p>
  
  <p>Any help is appreciated. thanks</p>