I have a DataGridView which is bound to a database. I also have an unbound image column. After the DataGridView is populated I click a button to go through the datagridview and mark some rows with an image however only 1 row has the image showing. When I click another button to mark some more rows with an image again only 1 image is displayed and the image that was displayed for the first button resets it's self.
I can't get more than 1 row to display the image. Here is the code which goes through, updates the database and sets the column "column1" to the image.
For a = 0 To Me.EmailDataSet.emails.Rows.Count - 1 emailsrow = Me.EmailDataSet.emails.Rows(a) If emailsrow.from = newwhitelist.ToString Then emailsrow("category") = "Whitelist" EmailDataSet.AcceptChanges() Me.DataGridView1.Rows(a).Cells("column1").Value = Image.FromFile("../../resources/white-sphere.gif") End If
Next Me.DataGridView1.Update() Me.DataGridView1.Refresh() Me.Refresh()