0

I am extremely confused on how to use this control properly, what my attempts are is to create a media library and to show cover art of movies in a detailed view but I am not understanding how to associate a particular column with a particular image. Any advice/tips?

I have a model object that I am using which contains movie details

public class MovieDetails
    {
        public string MovieName { get; set; }
        public string Key { get; set; }
        public string Id { get; set; }
        public string CoverArtUri { get; set; }
        public string MovieUri { get; set; }
        public string DownloadUri { get; set; }
        public int ItemCount { get; set; }
    }

//setup columns
        Generator.GenerateColumns(objectListView2, typeof(MovieDetails), true);

//show all movies from a-z
            DisplayAllMovies();

public void DisplayAllMovies()
        {
            try
            {
                objectListView2.UpdateObjects(movies);
            }
            catch (Exception)
            {

                throw;
            }
        }

and this is how I dyanmically add images to a imagelist, the Key is same as ID/Key of my object class

string imgloc = string.Format(@".\imgs\{0}.jpg", chunk.Id);
imageList1.Images.Add(chunk.Id, new Bitmap(imgloc));
nGX
  • 1,038
  • 1
  • 20
  • 40
  • What control do you want to display the images in ? This might help http://stackoverflow.com/questions/4996614/display-image-in-combobox-column-in-datagrid – ziddarth Apr 01 '15 at 17:40
  • This is for objectlistview – nGX Apr 01 '15 at 17:52

1 Answers1

1

This is unrelated to you question, but instead of

objectListView2.UpdateObjects(movies);

you probably want to use the SetObjects method.

Regarding using images you may find my answer here useful.

As a side note, while using

Generator.GenerateColumns(objectListView2, typeof(MovieDetails), true);

is easy, using the AspectGetter and AspectSetter handlers of each column gives you far more control over column contents.

Community
  • 1
  • 1
Rev
  • 5,827
  • 4
  • 27
  • 51