ICON not displayed on TreeListView

18 views Asked by At

I am using the 'TreeListView' component from BightIdeas Software to display a Tree view based on a custom class. The class is decorated with OLVColumn attributes to define the column names and display index. This all works fine but I now want to display an Icon on each line of the TreeView, where the Icon is based on a value of a property in the class. I updated the OLVColumn to be:

[OLVColumn(Title = "Name", DisplayIndex = 1, ImageAspectName = "ImageIcon")]        

and I have a property on the class called ImageIcon which returns the image based on the value of a property in the class:

public Icon ImageIcon => IconFactory.LoadIconFromResource(ElementType);

I know this property is returning an Icon but it is not being displayed in the TreeView. I created the columns using the code

TreeView.OwnerDraw = true;            
Generator.GenerateColumns(TreeView, typeof(IOTreeReference));

Any ideas why the Icon is not being displayed?

Thanks

0

There are 0 answers