Hi, I need to add multiple images to a list view item that is in each row of the list view and each column has different images ?
Regards, Fran
Hi, I need to add multiple images to a list view item that is in each row of the list view and each column has different images ?
Regards, Fran
First thing to ask which version of the control you're using? The more recent one allow such thing. All you need to do is to add the images to its associated ImageList and set the appropriated properties.
I'm not sure if I'm following the question exactly.
If you are asking how to associate two images to a single ListViewItem in one row of a ListView control I don't believe it is possible. I believe the image for each item acts as a unique key for that entry.
If you are asking how to create two entries in a ListView control with different images that otherwise have the same values you could use something like the following:
ImageList imgList = new ImageList();
listViewControl.SmallImageList = imgList;
imgList.Images.Add("image_one_key", new Icon("filenameOfImageOne"));
imgList.Images.Add("image_two_key", new Icon("filenameOfImageTwo"));
ListViewItem itemOne = new ListViewItem(("Test Object",imgList.Images.IndexOfKey("image_one_key"));
ListViewItem itemTwo = new ListViewItem(("Test Object", imgList.Images.IndexOfKey("image_two_key"));
listViewControl.Items.Add(itemOne);
listViewControl.Items.Add(itemTwo);