Search code examples
c#winforms.net-4.8objectlistview

ObjectListView not displaying images


So, I've been trying to make the objectlistview to display cover image next to the title. imgur

I want every row to have its own image of the album image, but the ImageAspectName doesnt seem to.. work? This is my item object, im using:

public class AudioDefinition
    {
        // metadata
        public Image audioCover;
        public string audioTitle;
        public string audioArtists;
        [...]
    }

the title and all are all there, but no images are displayed

How can i fix this issue?


Solution

  • As mentioned in the comments, the ImageAspectName requires a property instead of a field:

    public Image AudioCover { get; set; }
    

    You probably have to set OwnerDraw to true for the OLV to support image rendering:

    myOlv.OwnerDraw = true;