TreeView slowed by custom ButtonImageList/CheckImageList

Posted by: kbj on 8 May 2018, 12:51 pm EST

    • Post Options:
    • Link

    Posted 8 May 2018, 12:51 pm EST

    I have a treeview that uses custom ButtonImageList/CheckImageList (to display properly sized expand/contract and checkbox in a high dpi environment) that redraws much slower than the same treeview without the custom imagelists.

    I have to believe the bottleneck is in using a listview to retrieve the images rather than simply exposing an image property for each one of the expand and checked states. The treeview uses a custom CustomContentPresenter which draws images (not from a listview VERY quickly).

    Is there anyway to set the default expand/contract and checked images directly?

    As an aside, directly setting images in a ribbon menu is significantly faster than linking the control to a imageList. It must be either some slowdown in the way you retrieve the images from the imagelist, or a basic weakness in the imagelist class itself.

  • Posted 8 May 2018, 12:53 pm EST

    er above I meant “using an imageList to retrieve the images” not a listview

  • Posted 9 May 2018, 9:26 am EST

    Hello,

    If you wish to modify checked/expand node image using a single property, then the option available is to use CheckBoxStyle/ExpandButtonStyle properties. However, they consist of only 3 options to select from System/VS15/Windows10, giving limited flexibility.

    Moreover, did you try accessing the images from resources? That might result in better performance.

    Also, could you please share a video/application demonstrating how worse the treeview is performing as compared to without imagelist.

    Thanks,

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels