This is a migrated thread and some comments may be shown as answers.

TreeView, virtualization, style triggers, and DefaultImageSrc

1 Answer 146 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
Iron
Iron
David asked on 24 Feb 2016, 10:59 PM

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

 

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

 

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.

 

Thanks!

 

-David

 

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Petar Mladenov
Telerik team
answered on 29 Feb 2016, 12:39 PM
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.

Regards,
Petar Mladenov
Telerik
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
Tags
TreeView
Asked by
David
Top achievements
Rank 1
Iron
Iron
Answers by
Petar Mladenov
Telerik team
Share this question
or