I have a DGV named dataGridView1 that has two columns, an image column and a string column. I also have a custom Collection of data that I use to populate the DGV. In my particular application, each row will have a specified string in the string column and one of two images in the image column. I am having trouble with displaying the correct image in the image column when the DGV populates.
This is how I am filtering the data to what I want to put in the DGV:
var match = Core.Set.Servers.Where(ServerItem => ServerItem.GameTag == text);
Currently, I am doing this to populate the DGV:
dataGridView1.AutoGenerateColumns = false;
source = new BindingSource(match,null);
dataGridView1.DataSource = source;
However, the image cells just show the default broken image icon. My icon is located in
Directory.GetCurrentDirectory() + "//Images/favorite.png";
Is there a good way using a DataTable or even a BindingSource? Each item in the collection has two useful features: ServerItem.ServerName and ServerItem.IsFavorite. The first is a string, the second is a boolean. I want the favorite icon to be displayed in the icon column of each row that has IsFavorite==true.