I have a DataGridView on my form with the following columns defined:
Download (type DataGridViewCheckBoxColumn)
ImageName (type DataGridViewLinkColumn)
Thumbnail (type DataGridViewImageColumn)
NITFFile (type DataGridViewLinkColumn);
My question is how do I create a BindingList to populate the DataGridView properly?
I tried the following class (C# code)for my BindingList but it doesn't work. The only thing that shows up correctly in my DataGridView is the checkbox.
public class ImageDataSet
{
public ImageDataSet(CheckBox cb, string image_name, Image thumbnail, string nitf_image)
{
_myCB = cb;
_myImageName = image_name;
_myThumbnail = thumbnail;
_myNITFName = nitf_image;
}
private CheckBox _myCB;
public CheckBox MyCB
{
get { return _myCB; }
set { _myCB = value; }
}
private string _myImageName;
public string MyImageName
{
get { return _myImageName; }
set { _myImageName = value; }
}
private Image _myThumbnail;
public Image MyThumbnail
{
get { return _myThumbnail; }
set { _myThumbnail = value; }
}
private string _myNITFName;
public string MyNITFName
{
get { return _myNITFName; }
set { _myNITFName = value; }
}
}
This is how I try to add something to the BindingList:
myList.Add(new ImageDataSet(
new System.Windows.Forms.CheckBox(),
image_file,
Image.FromFile(imagefilename),
"Coming Soon"));
Any ideas on what I am doing wrong? (this is my first time working with BindingLists)
Thanks in advance!!!!
-Andrew