TreeView, virtualization, style triggers, and DefaultImageSrc

2 posts, 1 answers
  1. David
    David avatar
    25 posts
    Member since:
    Jan 2013

    Posted 24 Feb Link to this post

    Recently, when we enabled UI virtualization for RadTreeView in our application, our icons for the RadTreeViewItems disappeared.

    We set the icons (DefaultImageSrc) in DataTrigger setters in a style, as follows:


    <UserControl ...>
            <Style x:Key="TreeViewItemStyleBase" TargetType="{x:Type telerik:RadTreeViewItem}">
                    <DataTrigger Binding="{Binding ...}">
                        <Setter Property="DefaultImageSrc" Value="/Our App;component/Resources/Icons/grid.png" />
                    <DataTrigger Binding="{Binding ...}">
                        <Setter Property="DefaultImageSrc" Value="/Our App;component/Resources/Icons/bargraph.png" />


            <Style TargetType="{x:Type telerik:RadTreeViewItem}" BasedOn="{StaticResource TreeViewItemStyleBase}" />
                             IsVirtualizing="True" telerik:TreeViewPanel.VirtualizationMode="Hierarchical"
                             ... >


    This is with UI for WPF v. 2015.2.0401


    It looks like this is the known bug described here and here.   That is, the problem is that DefaultImageSrc is non-functional in virtualized trees.

    1) Can I get a confirmation that this bug is indeed causing our difficulty, please?  Is there anything else you see that would cause it?

    2) It looks like you all have declined to fix this bug in the past.  Still declining? :)

    3) I could recommend that the documentation for UI Virtualization with RadTreeView here be updated, please, to to include some very obvious notes, a) that enabling virtualization will disable DefaultImageSrc and ExpandedImageSrc (and any other TreeView features that don't work with virtualization?), and b) that workarounds are necessary.







  2. Answer
    Petar Mladenov
    Petar Mladenov avatar
    2882 posts

    Posted 29 Feb Link to this post

    Hi David,

    Thank you for your feedback. We will consider updating our documentation on several places regarding the ImageSource properties and the virtualization.

    Indeed, you have hit the issue described in the first feedback portal item.

    You can consider this as limitation and we have previously marked it as - "declined" - we will not aim at fixing it in the future. Actually, the DefaultImageSrc property is not unusable when the virtualization is ON. It does not work when set in style trigger, however, you can bind it to property from your ViewModel (via Style setter) and it should as expected. This is the workaround described in the mentioned feedback portal items.

    Petar Mladenov
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft R3 2016 release webinar banner
Back to Top